Fix memleak reported by Coverity: If we error out because we have a

hash with no key, then free the previously allocated data_stream.

NB: Fixes Coverity CID1039262

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2013-07-08 11:34:58 +01:00
parent b72e694573
commit e28f298dbd
1 changed files with 9 additions and 2 deletions

View File

@ -2891,8 +2891,15 @@ _eet_data_dump_encode(int parent_type,
node->type);
}
else
/* A Hash without key will not decode correctly. */
return NULL;
{
/* A Hash without key will not decode correctly. */
ds->data = NULL;
ds->size = 0;
eet_data_stream_free(ds);
return NULL;
}
for (n = node->values; n; n = n->next)
{