diff options
Diffstat (limited to 'src/pacman/sync.c')
-rw-r--r-- | src/pacman/sync.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 42a99020..3846b303 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -628,7 +628,15 @@ static int process_group(alpm_list_t *dbs, const char *group) group); select_display(pkgs); char *array = malloc(count); - multiselect_question(array, count); + if(!array) { + ret = 1; + goto cleanup; + } + if(multiselect_question(array, count)) { + ret = 1; + free(array); + goto cleanup; + } int n = 0; for(i = pkgs; i; i = alpm_list_next(i)) { if(array[n++] == 0) @@ -641,6 +649,7 @@ static int process_group(alpm_list_t *dbs, const char *group) goto cleanup; } } + free(array); } else { for(i = pkgs; i; i = alpm_list_next(i)) { alpm_pkg_t *pkg = alpm_list_getdata(i); |