From: Tobias Brunner Date: Mon, 30 Jun 2014 13:23:22 +0000 (+0200) Subject: parser-helper: Ensure file_next() does not remove the sentinel item X-Git-Tag: 5.2.0~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1be2b84124c950ce59feea8f1d3b3bc377818d0e;p=thirdparty%2Fstrongswan.git parser-helper: Ensure file_next() does not remove the sentinel item --- diff --git a/src/libstrongswan/utils/parser_helper.c b/src/libstrongswan/utils/parser_helper.c index 17307e92ca..4c6aa251fb 100644 --- a/src/libstrongswan/utils/parser_helper.c +++ b/src/libstrongswan/utils/parser_helper.c @@ -96,7 +96,7 @@ METHOD(parser_helper_t, file_next, FILE*, char *name; array_get(this->files, ARRAY_TAIL, &file); - if (!file->matches) + if (!file->matches && file->name) { array_remove(this->files, ARRAY_TAIL, NULL); parser_helper_file_destroy(file);