Browse code

core: In case of OOM, prevent crash

Marius Zbihlei authored on 14/01/2011 15:30:32
Showing 1 changed files
... ...
@@ -243,6 +243,7 @@ char* get_abs_pathname(str* base, str* file)
243 243
 		 * copy and use it as it is */
244 244
 		if ((res = pkg_malloc(file->len+1)) == NULL) {
245 245
 			ERR("get_abs_pathname: No memory left (pkg_malloc failed)\n");
246
+			return NULL;
246 247
 		}
247 248
 		memcpy(res, file->s, file->len);
248 249
 		res[file->len]=0;