From: Sebastian Harl Date: Fri, 17 Oct 2014 08:33:46 +0000 (+0200) Subject: frontend/parser: Don't override fields of unknown types. X-Git-Tag: sysdb-0.6.0~110 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9f7401c4f4fba09013324fb58553d26f3101dcdf;p=sysdb.git frontend/parser: Don't override fields of unknown types. --- diff --git a/src/frontend/parser.c b/src/frontend/parser.c index b0ae01a..f16b71f 100644 --- a/src/frontend/parser.c +++ b/src/frontend/parser.c @@ -115,12 +115,13 @@ sdb_fe_parse_matcher(const char *cond, int len) if (! node) return NULL; - if (node->cmd == CONNECTION_MATCHER) + if (node->cmd == CONNECTION_MATCHER) { m = CONN_MATCHER(node)->matcher; + CONN_MATCHER(node)->matcher = NULL; + } else m = NULL; - CONN_MATCHER(node)->matcher = NULL; sdb_llist_destroy(yyextra.parsetree); sdb_object_deref(SDB_OBJ(node)); return m; @@ -154,12 +155,13 @@ sdb_fe_parse_expr(const char *expr, int len) if (! node) return NULL; - if (node->cmd == CONNECTION_EXPR) + if (node->cmd == CONNECTION_EXPR) { e = CONN_EXPR(node)->expr; + CONN_EXPR(node)->expr = NULL; + } else e = NULL; - CONN_EXPR(node)->expr = NULL; sdb_llist_destroy(yyextra.parsetree); sdb_object_deref(SDB_OBJ(node)); return e;