]> git.ipfire.org Git - thirdparty/git.git/blobdiff - compat/nedmalloc/nedmalloc.c
nedmalloc: work around overzealous GCC 6 warning
[thirdparty/git.git] / compat / nedmalloc / nedmalloc.c
index 677d1b2794321c7bd31bb5ba15c4bf8f2d06759e..2d4ef59013823d3c7caac8b705fbd4916cfe8fd6 100644 (file)
@@ -955,12 +955,11 @@ void **nedpindependent_comalloc(nedpool *p, size_t elems, size_t *sizes, void **
  */
 char *strdup(const char *s1)
 {
-       char *s2 = 0;
-       if (s1) {
-               size_t len = strlen(s1) + 1;
-               s2 = malloc(len);
+       size_t len = strlen(s1) + 1;
+       char *s2 = malloc(len);
+
+       if (s2)
                memcpy(s2, s1, len);
-       }
        return s2;
 }
 #endif