diff options
author | Siavash Eliasi <[email protected]> | 2013-12-03 21:50:00 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2013-12-04 07:31:27 -0700 |
commit | f0cc59d68a9f5231e8e2111393a1834858820735 (patch) | |
tree | e8261356dc2405630122615badac6777ae760c81 /src/mesa/program/prog_parameter.c | |
parent | 267679be84de5bc9d2bd0fccb1712bc5cddb6be7 (diff) |
mesa: modified _mesa_align_free() to accept NULL pointer
So that it acts like ordinary free(). This lets us remove a bunch of
if statements where the function is called.
v2:
- Avoiding compile error on MSVC and possible warnings on other compilers.
- Added comment regards passing NULL pointer being safe.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/program/prog_parameter.c')
-rw-r--r-- | src/mesa/program/prog_parameter.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mesa/program/prog_parameter.c b/src/mesa/program/prog_parameter.c index 4d9cf08d211..54531d2550d 100644 --- a/src/mesa/program/prog_parameter.c +++ b/src/mesa/program/prog_parameter.c @@ -83,8 +83,7 @@ _mesa_free_parameter_list(struct gl_program_parameter_list *paramList) free((void *)paramList->Parameters[i].Name); } free(paramList->Parameters); - if (paramList->ParameterValues) - _mesa_align_free(paramList->ParameterValues); + _mesa_align_free(paramList->ParameterValues); free(paramList); } |