Prevent a memory leak in digest.c
[deb_shairplay.git] / src / lib / digest.c
index 78c916ea51dd03e94575fb53db00abc7bc4e69ee..22912157c4c3c777b5d79c49f052384353f4f3bb 100644 (file)
@@ -141,9 +141,11 @@ digest_is_valid(const char *our_realm, const char *password,
        }
 
        if (!username || !realm || !nonce || !uri || !response) {
+               free(auth);
                return 0;
        }
        if (strcmp(realm, our_realm) || strcmp(nonce, our_nonce) || strcmp(uri, our_uri)) {
+               free(auth);
                return 0;
        }