mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
mesa: fix memory leak when using shader cache
Fixes: 656ccf4ef8 ("mesa: shader dump/read support for ARB programs")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30302>
This commit is contained in:
parent
8ba8e33c39
commit
7513a0bf3a
1 changed files with 6 additions and 0 deletions
|
|
@ -402,6 +402,9 @@ set_program_string(struct gl_program *prog, GLenum target, GLenum format, GLsize
|
|||
}
|
||||
else {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glProgramStringARB(target)");
|
||||
#ifdef ENABLE_SHADER_CACHE
|
||||
free(replacement);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -460,6 +463,9 @@ set_program_string(struct gl_program *prog, GLenum target, GLenum format, GLsize
|
|||
}
|
||||
ralloc_free(filename);
|
||||
}
|
||||
#ifdef ENABLE_SHADER_CACHE
|
||||
free(replacement);
|
||||
#endif
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue