libalpm/remove.c: prevent undefined behaviour in shift_pacsave error path

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2024-01-26 19:43:14 +10:00
parent 2ba08e622b
commit f996f30163

View file

@ -420,7 +420,9 @@ static void shift_pacsave(alpm_handle_t *handle, const char *file)
cleanup:
free(dirname);
closedir(dir);
if(dir != NULL) {
closedir(dir);
}
}