Skip to content

Commit

Permalink
accessor: Add missing grn_obj_unref with nonexistent _mXXX (#1350)
Browse files Browse the repository at this point in the history
  • Loading branch information
HashidaTKS committed Apr 13, 2022
1 parent 2c15283 commit 8048fb8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
4 changes: 1 addition & 3 deletions lib/db.c
Original file line number Diff line number Diff line change
Expand Up @@ -7178,9 +7178,7 @@ grn_obj_get_accessor(grn_ctx *ctx, grn_obj *obj, const char *name, uint32_t name
goto exit;
}
} else {
if (!obj_is_referred) {
grn_obj_unref(ctx, obj);
}
grn_obj_unref(ctx, obj);
goto exit;
}
break;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
table_create Sites TABLE_HASH_KEY ShortText
[[0,0.0,0.0],true]
column_create Sites uri COLUMN_SCALAR ShortText
[[0,0.0,0.0],true]
load --table Sites
[
["_key","uri"],
["groonga","http://groonga.org/"]
]
[[0,0.0,0.0],1]
log_level --level dump
[[0,0.0,0.0],true]
select Sites --output_columns '_m_nonexistent'
[[0,0.0,0.0],[[[1],[],[]]]]
#|-| [obj][open] <256>(<Sites>):<48>(<table:hash_key>)
#|-| [obj][close] <256>(<Sites>):<48>(<table:hash_key>)
log_level --level notice
[[0,0.0,0.0],true]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#$GRN_ENABLE_REFERENCE_COUNT=yes
table_create Sites TABLE_HASH_KEY ShortText
column_create Sites uri COLUMN_SCALAR ShortText

load --table Sites
[
["_key","uri"],
["groonga","http://groonga.org/"]
]

log_level --level dump
#@add-important-log-levels dump
#@add-ignore-log-pattern /\A\[io\]/
select Sites --output_columns '_m_nonexistent'
log_level --level notice
#@remove-ignore-log-pattern /\A\[io\]/
#@remove-important-log-levels dump

0 comments on commit 8048fb8

Please sign in to comment.