Browse code

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 authored on 14/05/2014 20:56:37
Showing 1 changed files
... ...
@@ -2554,6 +2554,7 @@ struct rval_expr* mk_rval_expr_v(enum rval_type rv_type, void* val,
2554 2554
 			s=(str*)val;
2555 2555
 			v.s.s=pkg_malloc(s->len+1 /*0*/);
2556 2556
 			if (v.s.s==0){
2557
+				pkg_free(rve);
2557 2558
 				ERR("memory allocation failure\n");
2558 2559
 				return 0;
2559 2560
 			}