Ver código fonte

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 anos atrás
pai
commit
ace56c6bd2
1 arquivos alterados com 1 adições e 0 exclusões
  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;
 			}