Navigation Menu

Skip to content

Commit

Permalink
grn_pat: fix a bug of grn_pat_delete()
Browse files Browse the repository at this point in the history
Note that this is a quick-fix approach.

GitHub: #420
  • Loading branch information
s-yata committed Oct 19, 2015
1 parent f4bf9bd commit 14e634a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/pat.c
Expand Up @@ -1099,6 +1099,11 @@ _grn_pat_del(grn_ctx *ctx, grn_pat *pat, const char *key, uint32_t key_size, int
uint32_t len = key_size * 16;
grn_id r, otherside, *proot, *p, *p0 = NULL;

/* FIXME: This is a quick-fix approach. */
if (_grn_pat_get(ctx, pat, key, key_size, NULL) == GRN_ID_NIL) {
return GRN_INVALID_ARGUMENT;
}

/* delinfo_new() must be called before searching for rn. */
di = delinfo_new(ctx, pat);
di->shared = shared;
Expand Down

0 comments on commit 14e634a

Please sign in to comment.