Sfoglia il codice sorgente

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

- cleaner shut down if not enough memory at startup

(cherry picked from commit ace56c6bd2221920b965185c1c9a5997cd3f2768)
(cherry picked from commit c5c1002be8c4f3e24d1b79b77856db2879b97c72)
Daniel-Constantin Mierla 11 anni fa
parent
commit
662e767adf
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  1. 1 0
      rvalue.c

+ 1 - 0
rvalue.c

@@ -2544,6 +2544,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;
 			}