Move NULL check before dereference
Signed-off-by: Silvan Jegen <s.jegen@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
77da9dc974
commit
819b4cd54e
1 changed files with 7 additions and 7 deletions
|
@ -261,18 +261,18 @@ static void setuseragent(void)
|
||||||
*/
|
*/
|
||||||
static void cleanup(int ret)
|
static void cleanup(int ret)
|
||||||
{
|
{
|
||||||
|
if(config) {
|
||||||
/* free alpm library resources */
|
/* free alpm library resources */
|
||||||
if(config->handle && alpm_release(config->handle) == -1) {
|
if(config->handle && alpm_release(config->handle) == -1) {
|
||||||
pm_printf(ALPM_LOG_ERROR, "error releasing alpm library\n");
|
pm_printf(ALPM_LOG_ERROR, "error releasing alpm library\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* free memory */
|
|
||||||
FREELIST(pm_targets);
|
|
||||||
if(config) {
|
|
||||||
config_free(config);
|
config_free(config);
|
||||||
config = NULL;
|
config = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* free memory */
|
||||||
|
FREELIST(pm_targets);
|
||||||
exit(ret);
|
exit(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue