eet: handling memory leak on realloc fail.

Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

Differential Revision: https://phab.enlightenment.org/D3207

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
Srivardhan Hebbar 2015-10-21 13:50:17 -07:00 committed by Cedric BAIL
parent be464e5843
commit 80ccf755a6
1 changed files with 4 additions and 1 deletions

View File

@ -314,9 +314,12 @@ eet_identity_print(Eet_Key *key,
while ((err = gnutls_hex_encode(rsa_raw + i, res, &size)) ==
GNUTLS_E_SHORT_MEMORY_BUFFER)
{
char *temp;
size += 128;
if (!(res = realloc(res, size)))
if (!(temp = realloc(res, size)))
goto on_error;
res = temp;
}
if (err)
goto on_error;