1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

Fix memory leaks on error path

This commit is contained in:
Tim Potter 2008-02-18 21:00:51 +11:00 committed by Jeremy Allison
parent f7d2f69299
commit 47dd0700b4

View File

@ -38,8 +38,15 @@ static bool cli_link_internal(struct cli_state *cli, const char *oldname, const
size_t newlen = 2*(strlen(newname)+1);
param = SMB_MALLOC_ARRAY(char, 6+newlen+2);
if (!param) {
return false;
}
data = SMB_MALLOC_ARRAY(char, oldlen+2);
if (!param || !data) {
if (!data) {
SAFE_FREE(param);
return false;
}