src: check result of malloc when creating queue
PATCH 1/1 src: check result of malloc when creating queue
From: Victor Julien <[email protected]>
Signed-off-by Victor Julien <[email protected]>
--- src/libnetfilter_queue.c | 2 ++ 1 file changed, 2 insertions(+)
src/libnetfilter_queue.c +2 -0
@@ -536,6 +536,8 @@ struct nfq_q_handle *nfq_create_queue(struct nfq_handle *h,return NULL ; qh =malloc (sizeof (*qh)); +if (!qh) +return NULL ;memset (qh,0 ,sizeof (*qh)); qh->h = h;
Signature · 1 line
2.7.4
src/libnetfilter_queue.c struct nfq_q_handle *nfq_create_queue(struct nfq_handle *h, · line 540
Quoted 3 lines · [email protected] <[email protected]> wrote:
src/libnetfilter_queue.c +2
-0qh =malloc (sizeof (*qh)); +if (!qh) +return NULL ;
Applied, thanks for spotting this.