depmiss_new: free memory on error
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
bf06efaa78
commit
32ebd7ad5d
1 changed files with 6 additions and 2 deletions
|
@ -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);
|
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);
|
miss->depend = _alpm_dep_dup(dep);
|
||||||
STRDUP(miss->causingpkg, causingpkg, return NULL);
|
STRDUP(miss->causingpkg, causingpkg, goto error);
|
||||||
|
|
||||||
return miss;
|
return miss;
|
||||||
|
|
||||||
|
error:
|
||||||
|
alpm_depmissing_free(miss);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SYMEXPORT alpm_depmissing_free(alpm_depmissing_t *miss)
|
void SYMEXPORT alpm_depmissing_free(alpm_depmissing_t *miss)
|
||||||
|
|
Loading…
Add table
Reference in a new issue