Skip to content

Commit

Permalink
Fix small memory leak.
Browse files Browse the repository at this point in the history
When we start using the ignoredir alist we should initialize it to let
the code know its owns the data so it will free all data on a destroy.
  • Loading branch information
Marco van Wieringen committed Sep 15, 2014
1 parent 06c6128 commit b077af8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/dird/inc_conf.c
Expand Up @@ -656,14 +656,21 @@ static void store_fstype(LEX *lc, RES_ITEM *item, int index, int pass)
/* Store exclude directory containing info */
static void store_excludedir(LEX *lc, RES_ITEM2 *item, int index, int pass, bool exclude)
{
INCEXE *incexe;

if (exclude) {
scan_err0(lc, _("ExcludeDirContaining directive not permitted in Exclude.\n"));
/* NOT REACHED */
}

lex_get_token(lc, T_NAME);
if (pass == 1) {
res_incexe.ignoredir.append(bstrdup(lc->str));
incexe = &res_incexe;
if (incexe->ignoredir.size() == 0) {
incexe->ignoredir.init(10, true);
}
incexe->ignoredir.append(bstrdup(lc->str));
Dmsg1(900, "Add to ignoredir_list %s\n", lc->str);
}
scan_to_eol(lc);
}
Expand Down

0 comments on commit b077af8

Please sign in to comment.