Merge branch 'jk/remote-curl-an-array-in-struct-cannot-be-null' into maint
[gitweb.git] / grep.c
diff --git a/grep.c b/grep.c
index 6e085f829731146c319fff57da0ae482de97ff77..b58c7c64342698737f9c11b20457bd30ca1fc727 100644 (file)
--- a/grep.c
+++ b/grep.c
@@ -1661,8 +1661,8 @@ void grep_source_init(struct grep_source *gs, enum grep_source_type type,
                      const void *identifier)
 {
        gs->type = type;
-       gs->name = name ? xstrdup(name) : NULL;
-       gs->path = path ? xstrdup(path) : NULL;
+       gs->name = xstrdup_or_null(name);
+       gs->path = xstrdup_or_null(path);
        gs->buf = NULL;
        gs->size = 0;
        gs->driver = NULL;