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 <yunlian@chromium.org>
This commit is contained in:
Ben Chan
2013-04-24 17:37:55 -07:00
committed by Aleksander Morgado
parent d1708f243d
commit 1f99eaf80e

View File

@@ -53,13 +53,10 @@ static void
val_free (Val *v)
{
if (v->type == VAL_TYPE_STRING) {
if (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);
} else if (v->type == VAL_TYPE_U16_ARRAY) {
if (v->u.u16_array);
free (v->u.u16_array);
}
free (v->key);