diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index a1695b2f3..ca9c6237d 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.04 - ============================ + Add file & line to dm_strdup_aux(). Add setgeometry. Version 1.02.03 - 7 Feb 2006 diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h index 68359a4fe..9b6d3fa13 100644 --- a/libdm/libdevmapper.h +++ b/libdm/libdevmapper.h @@ -372,7 +372,7 @@ int dm_tree_node_add_target_area(struct dm_tree_node *node, void *dm_malloc_aux(size_t s, const char *file, int line); void *dm_malloc_aux_debug(size_t s, const char *file, int line); -char *dm_strdup_aux(const char *str); +char *dm_strdup_aux(const char *str, const char *file, int line); void dm_free_aux(void *p); void *dm_realloc_aux(void *p, unsigned int s, const char *file, int line); int dm_dump_memory_debug(void); @@ -381,7 +381,7 @@ void dm_bounds_check_debug(void); #ifdef DEBUG_MEM # define dm_malloc(s) dm_malloc_aux_debug((s), __FILE__, __LINE__) -# define dm_strdup(s) dm_strdup_aux(s) +# define dm_strdup(s) dm_strdup_aux((s), __FILE__, __LINE__) # define dm_free(p) dm_free_aux(p) # define dm_realloc(p, s) dm_realloc_aux(p, s, __FILE__, __LINE__) # define dm_dump_memory() dm_dump_memory_debug() diff --git a/libdm/mm/dbg_malloc.c b/libdm/mm/dbg_malloc.c index ee8e1afe9..348644448 100644 --- a/libdm/mm/dbg_malloc.c +++ b/libdm/mm/dbg_malloc.c @@ -18,9 +18,9 @@ #include #include -char *dm_strdup_aux(const char *str) +char *dm_strdup_aux(const char *str, const char *file, int line) { - char *ret = dm_malloc(strlen(str) + 1); + char *ret = dm_malloc_aux_debug(strlen(str) + 1, file, line); if (ret) strcpy(ret, str);