1. Mark Stuart
  2. yappi

Commits

ma...@localhost6.localdomain6  committed 64abe0f

handling statically allocated "N/A" case of fname

  • Participants
  • Parent commits fda1f20
  • Branches default

Comments (0)

Files changed (1)

File _yappi.c

View file
                           cumdiff * tickfactor() * flags.timing_sample);
 
     // Finished with fname - freeing copy allocated in _item2fname
-    free(fname);
+    if (strcmp(fname, "N/A") != 0)
+        free(fname);
 
     return 0;
 }
                           (pt->ttotal * tickfactor() * flags.timing_sample) / pt->callcount);
 
     // Finished with fname - freeing copy allocated in _item2fname
-    free(fname);
+    if (strcmp(fname, "N/A") != 0)
+        free(fname);
 
     if (!si)
         return 1; // abort enumeration
     _yformat_string(fname, temp, FUNC_NAME_LEN);
 
     // Finished with fname - freeing copy allocated in _item2fname
-    free(fname);
+    if (strcmp(fname, "N/A") != 0)
+        free(fname);
 
     _yformat_ulong(ctx->sched_cnt, temp);
     _yformat_double(ctx->ttotal * tickfactor(), temp);
     buf = PyString_FromString(temp);
 #endif
     if (!buf)
+        // Finished with fname - freeing copy allocated in _item2fname
+        // free(fname);
+
         return 0; // just continue.
 
     if (PyList_Append((PyObject *)arg, buf) < 0)
+        // Finished with fname - freeing copy allocated in _item2fname
+        // free(fname);
+
         return 0; // just continue.
 
+    // Finished with fname - freeing copy allocated in _item2fname
+    // free(fname);
+
     return 0;
 }