summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorSrivardhan Hebbar <sri.hebbar@samsung.com>2015-10-21 13:50:17 -0700
committerCedric BAIL <cedric@osg.samsung.com>2015-10-21 13:51:34 -0700
commit80ccf755a67cba8cad62efd6f3a5de3654adb6cc (patch)
tree2762f01bf031f77226521922b8731c86f163b114 /src/lib
parentbe464e5843dbf841386d070c44a0d7d8b6c59294 (diff)
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>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/eet/eet_cipher.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/eet/eet_cipher.c b/src/lib/eet/eet_cipher.c
index 6ccb9cc48c..9bff406713 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,
314 while ((err = gnutls_hex_encode(rsa_raw + i, res, &size)) == 314 while ((err = gnutls_hex_encode(rsa_raw + i, res, &size)) ==
315 GNUTLS_E_SHORT_MEMORY_BUFFER) 315 GNUTLS_E_SHORT_MEMORY_BUFFER)
316 { 316 {
317 char *temp;
318
317 size += 128; 319 size += 128;
318 if (!(res = realloc(res, size))) 320 if (!(temp = realloc(res, size)))
319 goto on_error; 321 goto on_error;
322 res = temp;
320 } 323 }
321 if (err) 324 if (err)
322 goto on_error; 325 goto on_error;