netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: lists@inliniac.net
To: netfilter-devel@vger.kernel.org
Cc: Victor Julien <victor@inliniac.net>
Subject: [PATCH libnetfilter_queue] src: check result of malloc when creating queue
Date: Sun,  3 Jul 2016 09:38:02 +0200	[thread overview]
Message-ID: <1467531482-28941-1-git-send-email-lists@inliniac.net> (raw)

From: Victor Julien <victor@inliniac.net>

Signed-off-by: Victor Julien <victor@inliniac.net>
---
 src/libnetfilter_queue.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/libnetfilter_queue.c b/src/libnetfilter_queue.c
index 5fbde5b..211a8ba 100644
--- a/src/libnetfilter_queue.c
+++ b/src/libnetfilter_queue.c
@@ -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;
-- 
2.7.4


             reply	other threads:[~2016-07-03  7:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-03  7:38 lists [this message]
2016-07-03  7:55 ` [PATCH libnetfilter_queue] src: check result of malloc when creating queue Florian Westphal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1467531482-28941-1-git-send-email-lists@inliniac.net \
    --to=lists@inliniac.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=victor@inliniac.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).