summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a0c8961)
raw | patch | inline | side by side (parent: a0c8961)
author | Sebastian Harl <sh@tokkee.org> | |
Wed, 23 Apr 2014 08:22:59 +0000 (10:22 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Wed, 23 Apr 2014 08:22:59 +0000 (10:22 +0200) |
src/core/store_lookup.c | patch | blob | history | |
src/frontend/grammar.y | patch | blob | history |
index bb32157402d8c047a20326aab81e069a4073e5f1..2affaa986f869e3c7514761857653203c291fefa 100644 (file)
--- a/src/core/store_lookup.c
+++ b/src/core/store_lookup.c
/* service = */ NULL,
sdb_store_attr_matcher(matcher, matcher_re, NULL, NULL));
- if (m && inv) {
+ if (! m)
+ return NULL;
+
+ /* pass ownership to the host matcher */
+ sdb_object_deref(SDB_OBJ(HOST_M(m)->service));
+ sdb_object_deref(SDB_OBJ(HOST_M(m)->attr));
+
+ if (inv) {
sdb_store_matcher_t *tmp;
tmp = sdb_store_inv_matcher(m);
/* pass ownership to the inverse matcher */
diff --git a/src/frontend/grammar.y b/src/frontend/grammar.y
index a261c4c81d3253320b9d8cf960378918f84d0249..450a20f34218ef1df4db9e713bb3b0247cddc0bb 100644 (file)
--- a/src/frontend/grammar.y
+++ b/src/frontend/grammar.y
matcher AND matcher
{
$$ = sdb_store_con_matcher($1, $3);
+ sdb_object_deref(SDB_OBJ($1));
+ sdb_object_deref(SDB_OBJ($3));
}
|
matcher OR matcher
{
$$ = sdb_store_dis_matcher($1, $3);
+ sdb_object_deref(SDB_OBJ($1));
+ sdb_object_deref(SDB_OBJ($3));
}
|
NOT matcher
{
$$ = sdb_store_inv_matcher($2);
+ sdb_object_deref(SDB_OBJ($2));
}
|
compare_matcher
%%
+/* XXX: on parse errors, allocated objects, strings, etc. need to be freed */
+
void
sdb_fe_yyerror(YYLTYPE *lval, sdb_fe_yyscan_t scanner, const char *msg)
{