[Groonga-commit] groonga/groonga at 197b297 [master] Add missing memory allocation log on strdup()

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jan 26 15:11:22 JST 2015


Kouhei Sutou	2015-01-26 15:11:22 +0900 (Mon, 26 Jan 2015)

  New Revision: 197b29721c479c7411adcf61701b102dea7ac8d1
  https://github.com/groonga/groonga/commit/197b29721c479c7411adcf61701b102dea7ac8d1

  Message:
    Add missing memory allocation log on strdup()

  Modified files:
    lib/ctx.c

  Modified: lib/ctx.c (+4 -0)
===================================================================
--- lib/ctx.c    2015-01-26 14:03:42 +0900 (c5144c8)
+++ lib/ctx.c    2015-01-26 15:11:22 +0900 (ff61f91)
@@ -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;
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index