Browse Source

core: free previous allocated variable if no more pkg to build rve struct

- cleaner shut down if not enough memory at startup
Daniel-Constantin Mierla 11 năm trước cách đây
mục cha
commit
ace56c6bd2
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      rvalue.c

+ 1 - 0
rvalue.c

@@ -2554,6 +2554,7 @@ struct rval_expr* mk_rval_expr_v(enum rval_type rv_type, void* val,
 			s=(str*)val;
 			v.s.s=pkg_malloc(s->len+1 /*0*/);
 			if (v.s.s==0){
+				pkg_free(rve);
 				ERR("memory allocation failure\n");
 				return 0;
 			}