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:
parent
00cd3f7d13
commit
aff845da67
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue