read_generic_file - add early return if rom_buf is NULL

This commit is contained in:
twinaphex 2015-02-19 04:21:08 +01:00
parent 0ea6dc0445
commit 932fc3d353

View File

@ -121,6 +121,9 @@ static bool read_generic_file(const char *path, void **buf, ssize_t *len)
if ((ret = fread(rom_buf, 1, _len, file)) < _len)
RARCH_WARN("Didn't read whole file.\n");
if (!rom_buf)
goto error;
*buf = rom_buf;
/* Allow for easy reading of strings to be safe.