From 1f99eaf80e6c3124c871c416638d50c57199535e Mon Sep 17 00:00:00 2001 From: Ben Chan Date: Wed, 24 Apr 2013 17:37:55 -0700 Subject: qcdm: remove unnecessary NULL check on free() This patch removes a few unnecessary NULL checks on free(), which also fixes the following clang warnings: result.c:59:27: error: if statement has empty body [-Werror,-Wempty-body] if (v->u.u8_array); ^ result.c:59:27: note: put the semicolon on a separate line to silence this warning result.c:62:28: error: if statement has empty body [-Werror,-Wempty-body] if (v->u.u16_array); ^ result.c:62:28: note: put the semicolon on a separate line to silence this warning Bug reported on https://code.google.com/p/chromium/issues/detail?id=219280 Patched by Yunlian Jiang --- libqcdm/src/result.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'libqcdm') diff --git a/libqcdm/src/result.c b/libqcdm/src/result.c index d51a0502..d508fb76 100644 --- a/libqcdm/src/result.c +++ b/libqcdm/src/result.c @@ -53,14 +53,11 @@ static void val_free (Val *v) { if (v->type == VAL_TYPE_STRING) { - if (v->u.s) - free (v->u.s); + free (v->u.s); } else if (v->type == VAL_TYPE_U8_ARRAY) { - if (v->u.u8_array); - free (v->u.u8_array); + free (v->u.u8_array); } else if (v->type == VAL_TYPE_U16_ARRAY) { - if (v->u.u16_array); - free (v->u.u16_array); + free (v->u.u16_array); } free (v->key); memset (v, 0, sizeof (*v)); -- cgit v1.2.3-70-g09d2