. In NDEBUG, safefree() is just free().

. Originally there were three places where a pointer was NULL'd after
  being freed.  One of these is actually important, so annotate it.
This commit is contained in:
Emil Mikulic 2003-11-24 12:21:33 +00:00
parent 7014380256
commit b2b6d75a05
1 changed files with 6 additions and 1 deletions

View File

@ -52,7 +52,11 @@
/* for easy defusal */
#define debugf printf
#ifdef NDEBUG
#define safefree free
#else
#define safefree(x) do { free(x); x = NULL; } while(0)
#endif
#ifndef min
#define min(a,b) ( ((a)<(b)) ? (a) : (b) )
@ -1651,7 +1655,8 @@ static void process_request(struct connection *conn)
conn->state = SEND_HEADER;
/* request not needed anymore */
safefree(conn->request);
free(conn->request);
conn->request = NULL; /* important: don't free it again later */
}