comparison utils.c @ 38:b156910b59b2

Wrap free() in dofree() to allow instrumenting it for debugging.
author David A. Holland
date Sat, 30 Mar 2013 21:02:25 -0400
parents 40748b097655
children 337110e7240a
comparison
equal deleted inserted replaced
37:70902cac4170 38:b156910b59b2
65 if (ret == NULL) { 65 if (ret == NULL) {
66 warnx("Out of memory"); 66 warnx("Out of memory");
67 die(); 67 die();
68 } 68 }
69 return ret; 69 return ret;
70 }
71
72 void
73 dofree(void *ptr)
74 {
75 free(ptr);
70 } 76 }
71 77
72 char * 78 char *
73 dostrdup(const char *s) 79 dostrdup(const char *s)
74 { 80 {