Backport a fix from CTags SVN to prevent possible crashes by trying to free NULL pointers.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4835 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2010-04-18 21:42:58 +00:00
parent 2f3aa8eb05
commit 1464cdd44a
2 changed files with 6 additions and 2 deletions

View File

@ -9,6 +9,8 @@
Use tm_source_file_set_tag_arglist() to set the argument list
field of Python class tags to the argument list of their
__init__() methods.
Backport a fix from CTags SVN to prevent possible crashes by trying
to free NULL pointers.
2010-04-17 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>

View File

@ -355,7 +355,8 @@ static void parseFunction (const char *cp, vString *const def,
cp = parseIdentifier (cp, def);
arglist = parseArglist (cp);
makeFunctionTag (def, parent, is_class_parent, arglist);
eFree (arglist);
if (arglist != NULL)
eFree (arglist);
}
/* Get the combined name of a nested symbol. Classes are separated with ".",
@ -747,7 +748,8 @@ static void findPythonTags (void)
/* show class members or top-level script lambdas only */
if (parent_is_class || vStringLength(parent) == 0)
makeFunctionTag (name, parent, parent_is_class, arglist);
eFree (arglist);
if (arglist != NULL)
eFree (arglist);
}
else
{