travis-ci: create the cache directory early in the build process
[gitweb.git] / credential.c
index 0ab247ff40a03b6da6281814cc7b41edca934bb5..9747f47b18bf2e622f11f41889faaa4b1845ac8d 100644 (file)
@@ -1,4 +1,5 @@
 #include "cache.h"
+#include "config.h"
 #include "credential.h"
 #include "string-list.h"
 #include "run-command.h"
@@ -313,10 +314,8 @@ void credential_reject(struct credential *c)
        for (i = 0; i < c->helpers.nr; i++)
                credential_do(c, c->helpers.items[i].string, "erase");
 
-       free(c->username);
-       c->username = NULL;
-       free(c->password);
-       c->password = NULL;
+       FREE_AND_NULL(c->username);
+       FREE_AND_NULL(c->password);
        c->approved = 0;
 }