]> granicus.if.org Git - libnl/commitdiff
nl_recv: Don't update *buf in error path
authorThomas Graf <tgraf@redhat.com>
Mon, 5 Nov 2012 23:21:35 +0000 (00:21 +0100)
committerThomas Graf <tgraf@redhat.com>
Mon, 5 Nov 2012 23:21:35 +0000 (00:21 +0100)
iov.iov_base is either NULL or invalid

lib/nl.c

index 0ed248e7b5554170540239f0fbd794ea68dc65bf..6ba4828ef4fe8745cfaac27596d52ebed1e1cbf1 100644 (file)
--- 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;