From: Thomas Graf Date: Mon, 5 Nov 2012 23:21:35 +0000 (+0100) Subject: nl_recv: Don't update *buf in error path X-Git-Tag: libnl3_2_15~52 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6d52ae6440fe324e94b1a08ebd40bc6e81d333f3;p=libnl nl_recv: Don't update *buf in error path iov.iov_base is either NULL or invalid --- 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;