Skip to content

Commit

Permalink
ii: use GRN_MALLOC/FREE for grn_ii
Browse files Browse the repository at this point in the history
GitHub: #513
  • Loading branch information
s-yata committed Apr 5, 2016
1 parent f40ce10 commit 19d6bf5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ii.c
Expand Up @@ -3741,7 +3741,7 @@ grn_ii *
grn_ii_create(grn_ctx *ctx, const char *path, grn_obj *lexicon, uint32_t flags)
{
grn_ii *ii = NULL;
if (!(ii = GRN_GMALLOC(sizeof(grn_ii)))) {
if (!(ii = GRN_MALLOCN(grn_ii, 1))) {
return NULL;
}
GRN_DB_OBJ_SET_TYPE(ii, GRN_COLUMN_INDEX);
Expand Down Expand Up @@ -3842,7 +3842,7 @@ grn_ii_open(grn_ctx *ctx, const char *path, grn_obj *lexicon)
grn_io_close(ctx, chunk);
return NULL;
}
if (!(ii = GRN_GMALLOC(sizeof(grn_ii)))) {
if (!(ii = GRN_MALLOCN(grn_ii, 1))) {
grn_io_close(ctx, seg);
grn_io_close(ctx, chunk);
return NULL;
Expand All @@ -3868,7 +3868,7 @@ grn_ii_close(grn_ctx *ctx, grn_ii *ii)
if (!ii) { return GRN_INVALID_ARGUMENT; }
if ((rc = grn_io_close(ctx, ii->seg))) { return rc; }
if ((rc = grn_io_close(ctx, ii->chunk))) { return rc; }
GRN_GFREE(ii);
GRN_FREE(ii);
/*
{
int i;
Expand Down

0 comments on commit 19d6bf5

Please sign in to comment.