From 014b1d60419ae7d6b3c9079cc5fdd30c5ed406ed Mon Sep 17 00:00:00 2001 From: Tim Ruehsen Date: Mon, 16 Mar 2015 21:28:25 +0100 Subject: [PATCH] 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 b7020efd..a4c30d5d 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; }