From 1fbc58b2e0b5be09c91532e9d1465fe54cdcb057 Mon Sep 17 00:00:00 2001 From: Tim Ruehsen Date: Mon, 16 Mar 2015 21:28:25 +0100 Subject: [PATCH 2/2] src/http.c: fix error return of digest_authentication_encode() Reported-by: Coverity bug #1188036 --- src/http.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/http.c b/src/http.c index b7020ef..a4c30d5 100644 --- a/src/http.c +++ b/src/http.c @@ -3859,15 +3859,17 @@ digest_authentication_encode (const char *au, const char *user, if (!realm || !nonce || !user || !passwd || !path || !method || !qop) { + if (!qop) + *auth_err = UNKNOWNATTR; + else + *auth_err = ATTRMISSING; + xfree (realm); xfree (opaque); xfree (nonce); xfree (qop); xfree (algorithm); - if (!qop) - *auth_err = UNKNOWNATTR; - else - *auth_err = ATTRMISSING; + return NULL; } -- 2.1.4