Handle a text NULL pointer more gracefully

svn path=/trunk/; revision=29491
This commit is contained in:
Kovarththanan Rajaratnam 2009-08-21 11:31:21 +00:00
parent 27f7d88c84
commit 2afdee256c
1 changed files with 10 additions and 1 deletions

View File

@ -211,7 +211,14 @@ dfilter_compile(const gchar *text, dfilter_t **dfp)
gboolean failure = FALSE;
const char *depr_test;
guint i;
GPtrArray *deprecated = g_ptr_array_new();
GPtrArray *deprecated;
g_assert(dfp);
if (!text) {
*dfp = NULL;
return FALSE;
}
dfilter_error_msg = NULL;
@ -223,6 +230,8 @@ dfilter_compile(const gchar *text, dfilter_t **dfp)
df_scanner_text(text);
deprecated = g_ptr_array_new();
while (1) {
df_lval = stnode_new(STTYPE_UNINITIALIZED, NULL);
token = df_lex();