Ensure regex object is always initialized

This avoids a crash in filetarget_free() when regex support isn't
requested in files_search().
This commit is contained in:
Dave Reisner 2019-12-24 07:40:53 -05:00 committed by Allan McRae
parent 56e0763c6d
commit ffb69c700a

View file

@ -114,7 +114,7 @@ static int files_search(alpm_list_t *syncs, alpm_list_t *targets, int regex) {
char *targ = t->data; char *targ = t->data;
size_t len = strlen(targ); size_t len = strlen(targ);
int exact_file = strchr(targ, '/') != NULL; int exact_file = strchr(targ, '/') != NULL;
regex_t reg; regex_t reg = {0};
if(exact_file) { if(exact_file) {
while(len > 1 && targ[0] == '/') { while(len > 1 && targ[0] == '/') {