fix_load_file_mem: add trailing NULL

This commit is contained in:
James Sullins committed 2011-11-02 08:34:03 -05:00
1 parent 895867d50f
commit 0e88c0d6f9
1 file changed
+2 -1
+2 -1
View File
@@ -410,7 +410,8 @@ ssize_t fs_load_file_mem(const char *path, void **ptr)
struct file_stat stat;
fs_stat_file(cookie, &stat);
*ptr = malloc(stat.size);
*ptr = malloc(stat.size + 1);
ptr[stat.size] = NULL;
if (!(*ptr)) return -1;