intel/tools: fix potential memory leaks
CID: 1444041 CID: 1444104 Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11574>
This commit is contained in:
committed by
Marge Bot
parent
14227b3364
commit
5c5423e6ee
@@ -459,6 +459,9 @@ maybe_init(int fd)
|
||||
fail_if(device == -1, "Unknown platform '%s'\n", value);
|
||||
device_override = true;
|
||||
} else if (!strcmp(key, "file")) {
|
||||
free(output_filename);
|
||||
if (output_file)
|
||||
fclose(output_file);
|
||||
output_filename = strdup(value);
|
||||
output_file = fopen(output_filename, "w+");
|
||||
fail_if(output_file == NULL,
|
||||
|
||||
Reference in New Issue
Block a user