ESexp: Check for NULL before freeing a GPtrArray
authorTristan Van Berkom <tristanvb@openismus.com>
Fri, 22 Nov 2013 13:54:19 +0000 (22:54 +0900)
committerTristan Van Berkom <tristanvb@openismus.com>
Sun, 24 Nov 2013 13:23:45 +0000 (22:23 +0900)
libedataserver/e-sexp.c

index d3b0146..d661362 100644 (file)
@@ -205,7 +205,8 @@ e_sexp_result_free (struct _ESExp *f,
 
        switch (t->type) {
        case ESEXP_RES_ARRAY_PTR:
-               g_ptr_array_free (t->value.ptrarray, TRUE);
+               if (t->value.ptrarray)
+                       g_ptr_array_free (t->value.ptrarray, TRUE);
                break;
        case ESEXP_RES_BOOL:
        case ESEXP_RES_INT: