forked from enlightenment/efl
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:
parent
be464e5843
commit
80ccf755a6
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue