summaryrefslogtreecommitdiffstats
path: root/lib/nl.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@redhat.com>2012-11-05 23:21:35 (GMT)
committerThomas Graf <tgraf@redhat.com>2012-11-05 23:21:35 (GMT)
commit6d52ae6440fe324e94b1a08ebd40bc6e81d333f3 (patch)
tree43fcfc752d509ebd28022dc44539032c0e49baa4 /lib/nl.c
parentceb8fb9e8747dd21f4067720e1090384910d348b (diff)
downloadlibnl-6d52ae6440fe324e94b1a08ebd40bc6e81d333f3.zip
libnl-6d52ae6440fe324e94b1a08ebd40bc6e81d333f3.tar.gz
libnl-6d52ae6440fe324e94b1a08ebd40bc6e81d333f3.tar.bz2
nl_recv: Don't update *buf in error path
iov.iov_base is either NULL or invalid
Diffstat (limited to 'lib/nl.c')
-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;