diff options
author | Matt Turner <[email protected]> | 2014-09-21 21:13:33 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2014-12-08 17:02:19 -0800 |
commit | 9019e5e19532fe214fc6e45b9ee1f60bbe332456 (patch) | |
tree | c382866b78653aea157f085c9cdb8bd3695798e8 /src/mesa | |
parent | cae7a2a0319e31eef0975edafc730efd3bd2c8d4 (diff) |
Remove useless checks for NULL before freeing
See commits 5067506e and b6109de3 for the Coccinelle script.
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/common/xmlconfig.c | 3 | ||||
-rw-r--r-- | src/mesa/main/objectlabel.c | 7 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/common/xmlconfig.c b/src/mesa/drivers/dri/common/xmlconfig.c index 8e48522e2e7..d69eb0196d3 100644 --- a/src/mesa/drivers/dri/common/xmlconfig.c +++ b/src/mesa/drivers/dri/common/xmlconfig.c @@ -312,8 +312,7 @@ static unsigned char parseValue (driOptionValue *v, driOptionType type, v->_float = strToF (string, &tail); break; case DRI_STRING: - if (v->_string) - free (v->_string); + free (v->_string); v->_string = strndup(string, STRING_CONF_MAXLEN); return GL_TRUE; } diff --git a/src/mesa/main/objectlabel.c b/src/mesa/main/objectlabel.c index 8efc33e0dd0..efa7ba8d19a 100644 --- a/src/mesa/main/objectlabel.c +++ b/src/mesa/main/objectlabel.c @@ -45,11 +45,8 @@ static void set_label(struct gl_context *ctx, char **labelPtr, const char *label, int length, const char *caller) { - if (*labelPtr) { - /* free old label string */ - free(*labelPtr); - *labelPtr = NULL; - } + free(*labelPtr); + *labelPtr = NULL; /* set new label string */ if (label) { |