summaryrefslogtreecommitdiff
path: root/alias.c
diff options
context:
space:
mode:
Diffstat (limited to 'alias.c')
-rw-r--r--alias.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/alias.c b/alias.c
index caa88e047c..bf146e5263 100644
--- a/alias.c
+++ b/alias.c
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "config.h"
struct config_alias_data {
const char *alias;
@@ -61,8 +62,7 @@ int split_cmdline(char *cmdline, const char ***argv)
src++;
c = cmdline[src];
if (!c) {
- free(*argv);
- *argv = NULL;
+ FREE_AND_NULL(*argv);
return -SPLIT_CMDLINE_BAD_ENDING;
}
}
@@ -74,8 +74,7 @@ int split_cmdline(char *cmdline, const char ***argv)
cmdline[dst] = 0;
if (quoted) {
- free(*argv);
- *argv = NULL;
+ FREE_AND_NULL(*argv);
return -SPLIT_CMDLINE_UNCLOSED_QUOTE;
}