Navigation Menu

Skip to content

Commit

Permalink
Add missing memory allocation log on strdup()
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 26, 2015
1 parent f79935b commit 197b297
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ctx.c
Expand Up @@ -2785,9 +2785,13 @@ grn_strdup_default(grn_ctx *ctx, const char *s, const char* file, int line, cons
char *res = strdup(s);
if (res) {
GRN_ADD_ALLOC_COUNT(1);
grn_alloc_info_add(res);
} else {
if (!(res = strdup(s))) {
MERR("strdup(%p)=%p (%s:%d) <%d>", s, res, file, line, alloc_count);
} else {
GRN_ADD_ALLOC_COUNT(1);
grn_alloc_info_add(res);
}
}
return res;
Expand Down

0 comments on commit 197b297

Please sign in to comment.