mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
. 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:
parent
7014380256
commit
b2b6d75a05
@ -52,7 +52,11 @@
|
|||||||
/* for easy defusal */
|
/* for easy defusal */
|
||||||
#define debugf printf
|
#define debugf printf
|
||||||
|
|
||||||
|
#ifdef NDEBUG
|
||||||
|
#define safefree free
|
||||||
|
#else
|
||||||
#define safefree(x) do { free(x); x = NULL; } while(0)
|
#define safefree(x) do { free(x); x = NULL; } while(0)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef min
|
#ifndef min
|
||||||
#define min(a,b) ( ((a)<(b)) ? (a) : (b) )
|
#define min(a,b) ( ((a)<(b)) ? (a) : (b) )
|
||||||
@ -1651,7 +1655,8 @@ static void process_request(struct connection *conn)
|
|||||||
conn->state = SEND_HEADER;
|
conn->state = SEND_HEADER;
|
||||||
|
|
||||||
/* request not needed anymore */
|
/* request not needed anymore */
|
||||||
safefree(conn->request);
|
free(conn->request);
|
||||||
|
conn->request = NULL; /* important: don't free it again later */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user