Ver código fonte

core: In case of OOM, prevent crash

Marius Zbihlei 14 anos atrás
pai
commit
2453a41d48
1 arquivos alterados com 1 adições e 0 exclusões
  1. 1 0
      ut.c

+ 1 - 0
ut.c

@@ -243,6 +243,7 @@ char* get_abs_pathname(str* base, str* file)
 		 * copy and use it as it is */
 		if ((res = pkg_malloc(file->len+1)) == NULL) {
 			ERR("get_abs_pathname: No memory left (pkg_malloc failed)\n");
+			return NULL;
 		}
 		memcpy(res, file->s, file->len);
 		res[file->len]=0;