summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Graf <tgraf@redhat.com>2012-11-06 00:21:35 +0100
committerThomas Graf <tgraf@redhat.com>2012-11-06 00:21:35 +0100
commit6d52ae6440fe324e94b1a08ebd40bc6e81d333f3 (patch)
tree43fcfc752d509ebd28022dc44539032c0e49baa4
parentceb8fb9e8747dd21f4067720e1090384910d348b (diff)
downloadlibnl-6d52ae6440fe324e94b1a08ebd40bc6e81d333f3.tar.gz
nl_recv: Don't update *buf in error path
iov.iov_base is either NULL or invalid
-rw-r--r--lib/nl.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/nl.c b/lib/nl.c
index 0ed248e..6ba4828 100644
--- a/lib/nl.c
+++ b/lib/nl.c
@@ -551,9 +551,8 @@ abort:
if (retval <= 0) {
free(iov.iov_base); iov.iov_base = NULL;
free(tmpcreds); tmpcreds = NULL;
- }
-
- *buf = iov.iov_base;
+ } else
+ *buf = iov.iov_base;
if (creds)
*creds = tmpcreds;