浏览代码

core: In case of OOM, prevent crash

Marius Zbihlei 14 年之前
父节点
当前提交
2453a41d48
共有 1 个文件被更改,包括 1 次插入0 次删除
  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;