1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-10 11:35:00 -05:00

depmiss_new: free memory on error

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2014-12-21 23:48:48 +10:00
parent bf06efaa78
commit 32ebd7ad5d

View File

@ -50,11 +50,15 @@ static alpm_depmissing_t *depmiss_new(const char *target, alpm_depend_t *dep,
MALLOC(miss, sizeof(alpm_depmissing_t), return NULL);
STRDUP(miss->target, target, return NULL);
STRDUP(miss->target, target, goto error);
miss->depend = _alpm_dep_dup(dep);
STRDUP(miss->causingpkg, causingpkg, return NULL);
STRDUP(miss->causingpkg, causingpkg, goto error);
return miss;
error:
alpm_depmissing_free(miss);
return NULL;
}
void SYMEXPORT alpm_depmissing_free(alpm_depmissing_t *miss)