Navigation Menu

Skip to content

Commit

Permalink
Make registered proc check more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 9, 2013
1 parent 1bf5216 commit cf98616
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/db.c
Expand Up @@ -583,7 +583,9 @@ grn_proc_create(grn_ctx *ctx, const char *name, int name_size, grn_proc_type typ
if (!added) {
db_value *vp;
if ((vp = grn_tiny_array_at(&s->values, id)) && (res = (grn_proc *)vp->ptr)) {
if (res->funcs[PROC_INIT]) {
if (res->funcs[PROC_INIT] ||
res->funcs[PROC_NEXT] ||
res->funcs[PROC_FIN]) {
ERR(GRN_INVALID_ARGUMENT, "already used name");
GRN_API_RETURN(NULL);
}
Expand Down

0 comments on commit cf98616

Please sign in to comment.