소스 검색

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 년 전
부모
커밋
662e767adf
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  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;
 			}