diff --git a/parser/parser_lex.l b/parser/parser_lex.l index 7093759dc..9fca6ad09 100644 --- a/parser/parser_lex.l +++ b/parser/parser_lex.l @@ -1,8 +1,8 @@ /* * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 * NOVELL (All rights reserved) - * Copyright (c) 2010 - 2012 - * Canonical Ltd. + * Copyright (c) 2010 - 2013 + * Canonical Ltd. (All rights reserved) * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public @@ -167,8 +167,10 @@ static int include_dir_cb(__unused DIR *dir, const char *name, struct stat *st, if (asprintf(&path, "%s/%s", d->fullpath, name) < 0) yyerror("Out of memory"); - if (is_blacklisted(name, path)) + if (is_blacklisted(name, path)) { + free(path); return 0; + } if (S_ISREG(st->st_mode)) { if (!(yyin = fopen(path,"r"))) diff --git a/parser/parser_misc.c b/parser/parser_misc.c index f3251ab96..2b819796d 100644 --- a/parser/parser_misc.c +++ b/parser/parser_misc.c @@ -2,6 +2,9 @@ * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 * NOVELL (All rights reserved) * + * Copyright (c) 2013 + * Canonical Ltd. (All rights reserved) + * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License published by the Free Software Foundation. @@ -874,6 +877,8 @@ void free_cod_entries(struct cod_entry *list) free(list->name); if (list->link_name) free(list->link_name); + if (list->nt_name) + free(list->nt_name); if (list->pat.regex) free(list->pat.regex); free(list); diff --git a/parser/profile.cc b/parser/profile.cc index 0914a53ea..62da9939d 100644 --- a/parser/profile.cc +++ b/parser/profile.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 + * Copyright (c) 2012, 2013 * Canonical, Ltd. (All rights reserved) * * This program is free software; you can redistribute it and/or @@ -72,12 +72,17 @@ Profile::~Profile() aare_delete_ruleset(policy.rules); if (policy.dfa) free(policy.dfa); + if (xmatch) + free(xmatch); if (name) free(name); if (attachment) free(attachment); if (ns) free(ns); + for (int i = (AA_EXEC_LOCAL >> 10) + 1; i < AA_EXEC_COUNT; i++) + if (exec_table[i]) + free(exec_table[i]); if (net.allow) free(net.allow); if (net.audit)