Explorar o código

core: In case of OOM, prevent crash

Marius Zbihlei %!s(int64=14) %!d(string=hai) anos
pai
achega
2453a41d48
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  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;