mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-15 21:59:41 -04:00
MINOR: chunk: New function free_trash_buffers()
This new function is meant to be called in the general deinit phase, to free those two internal chunks.
This commit is contained in:
parent
845efb53c7
commit
60deeba090
2 changed files with 12 additions and 0 deletions
|
|
@ -48,6 +48,7 @@ int chunk_asciiencode(struct chunk *dst, struct chunk *src, char qc);
|
|||
int chunk_strcmp(const struct chunk *chk, const char *str);
|
||||
int chunk_strcasecmp(const struct chunk *chk, const char *str);
|
||||
int alloc_trash_buffers(int bufsize);
|
||||
void free_trash_buffers(void);
|
||||
struct chunk *get_trash_chunk(void);
|
||||
|
||||
static inline void chunk_reset(struct chunk *chk)
|
||||
|
|
|
|||
11
src/chunk.c
11
src/chunk.c
|
|
@ -65,6 +65,17 @@ int alloc_trash_buffers(int bufsize)
|
|||
return trash_buf1 && trash_buf2;
|
||||
}
|
||||
|
||||
/*
|
||||
* free the trash buffers
|
||||
*/
|
||||
void free_trash_buffers(void)
|
||||
{
|
||||
free(trash_buf2);
|
||||
free(trash_buf1);
|
||||
trash_buf2 = NULL;
|
||||
trash_buf1 = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Does an snprintf() at the beginning of chunk <chk>, respecting the limit of
|
||||
* at most chk->size chars. If the chk->len is over, nothing is added. Returns
|
||||
|
|
|
|||
Loading…
Reference in a new issue