From: Srivardhan Hebbar Date: Wed, 21 Oct 2015 20:50:17 +0000 (-0700) Subject: eet: handling memory leak on realloc fail. X-Git-Tag: v1.16.0-beta3~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=80ccf755a67cba8cad62efd6f3a5de3654adb6cc;p=platform%2Fupstream%2Fefl.git eet: handling memory leak on realloc fail. Summary: Signed-off-by: Srivardhan Hebbar Reviewers: cedric Differential Revision: https://phab.enlightenment.org/D3207 Signed-off-by: Cedric BAIL --- diff --git a/src/lib/eet/eet_cipher.c b/src/lib/eet/eet_cipher.c index 6ccb9cc..9bff406 100644 --- a/src/lib/eet/eet_cipher.c +++ b/src/lib/eet/eet_cipher.c @@ -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;