Skip to contentSkip to conversation

src: check result of malloc when creating queue

PATCH Applied [email protected] 2 participants 2 messages Jul 3, 2016 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 src: check result of malloc when creating queue

From: Victor Julien <[email protected]>

---
 src/libnetfilter_queue.c | 2 ++
 1 file changed, 2 insertions(+)
src/libnetfilter_queue.c +2 -0
index 5fbde5b..211a8ba 100644
@@ -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
maintainer Applied
#1 lore raw

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 -0
 	qh = malloc(sizeof(*qh));
+	if (!qh)
+		return NULL;

Applied, thanks for spotting this.