intel/tools/aubinator_error_decode: fix small memory leaks

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7994>
This commit is contained in:
Marcin Ślusarz 2020-12-08 19:38:01 +01:00 committed by Marge Bot
parent 00cd3f7d13
commit aff845da67
1 changed files with 2 additions and 3 deletions

View File

@ -762,18 +762,17 @@ open_error_state_file(const char *path)
ret = asprintf(&filename, "%s/i915_error_state", path);
assert(ret > 0);
file = fopen(filename, "r");
free(filename);
if (!file) {
int minor;
free(filename);
for (minor = 0; minor < 64; minor++) {
ret = asprintf(&filename, "%s/%d/i915_error_state", path, minor);
assert(ret > 0);
file = fopen(filename, "r");
free(filename);
if (file)
break;
free(filename);
}
}
if (!file) {