mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
mesa: Close fp on error path.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
e3d9125b77
commit
058c70bae1
1 changed files with 4 additions and 6 deletions
|
|
@ -10086,15 +10086,12 @@ print_list(struct gl_context *ctx, GLuint list, const char *fname)
|
|||
|
||||
if (!islist(ctx, list)) {
|
||||
fprintf(f, "%u is not a display list ID\n", list);
|
||||
return;
|
||||
goto out;
|
||||
}
|
||||
|
||||
dlist = _mesa_lookup_list(ctx, list);
|
||||
if (!dlist) {
|
||||
if (fname) {
|
||||
fclose(f);
|
||||
}
|
||||
return;
|
||||
goto out;
|
||||
}
|
||||
|
||||
n = dlist->Head;
|
||||
|
|
@ -10366,7 +10363,7 @@ print_list(struct gl_context *ctx, GLuint list, const char *fname)
|
|||
printf
|
||||
("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
|
||||
opcode, (void *) n);
|
||||
return;
|
||||
goto out;
|
||||
}
|
||||
else {
|
||||
fprintf(f, "command %d, %u operands\n", opcode,
|
||||
|
|
@ -10380,6 +10377,7 @@ print_list(struct gl_context *ctx, GLuint list, const char *fname)
|
|||
}
|
||||
}
|
||||
|
||||
out:
|
||||
fflush(f);
|
||||
if (fname)
|
||||
fclose(f);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue