mirror of
https://github.com/jorisvink/kore
synced 2025-03-09 12:39:01 -04:00
make sure method, path and host are free'd in case of failure.
This commit is contained in:
parent
05156c9a3a
commit
4fc434e909
12
src/spdy.c
12
src/spdy.c
@ -157,11 +157,21 @@ spdy_ctrl_frame_syn_stream(struct netbuf *nb)
|
||||
s->header_pairs = net_read32(s->header_block);
|
||||
kore_log("got %d headers", s->header_pairs);
|
||||
|
||||
path = NULL;
|
||||
host = NULL;
|
||||
method = NULL;
|
||||
|
||||
#define GET_HEADER(n, r) \
|
||||
if (!spdy_stream_get_header(s, n, r)) { \
|
||||
if (!spdy_stream_get_header(s, n, r)) { \
|
||||
free(s->header_block); \
|
||||
free(s); \
|
||||
kore_log("no such header: %s", n); \
|
||||
if (path != NULL) \
|
||||
free(path); \
|
||||
if (host != NULL) \
|
||||
free(host); \
|
||||
if (method != NULL) \
|
||||
free(method); \
|
||||
return (KORE_RESULT_ERROR); \
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user