]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - gmqcc.h
Added tracing to strdup for allocations, fixed some memleaks, this isn't pretty ...
[xonotic/gmqcc.git] / gmqcc.h
diff --git a/gmqcc.h b/gmqcc.h
index fbddf15da657ef89321d047c4d7d14a7b1ef64de..223e0d7559e2ce4e9bb80fedcc482b0a48e88109 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
@@ -300,7 +300,7 @@ void  util_meminfo       ();
 bool  util_filexists     (const char *);
 bool  util_strupper      (const char *);
 bool  util_strdigit      (const char *);
-char *util_strdup        (const char *);
+char *_util_Estrdup        (const char *, const char *, size_t);
 void  util_debug         (const char *, const char *, ...);
 void  util_endianswap    (void *,  size_t, unsigned int);
 
@@ -326,6 +326,8 @@ int util_asprintf (char **ret, const char *fmt, ...);
 #    define mem_r(x, n) util_memory_r((void*)(x), (n), __LINE__, __FILE__)
 #endif /*! NOTRACK */
 
+#define util_strdup(X)  _util_Estrdup((X), __FILE__, __LINE__)
+
 /*
  * A flexible vector implementation: all vector pointers contain some
  * data about themselfs exactly - sizeof(vector_t) behind the pointer