gitweb: No error messages with unescaped/unprotected user input
[gitweb.git] / combine-diff.c
index 1bc1484645b4021ee71415f3b3ed44e4c88030d6..919112bba9271a8e3903b06946cf91036411f1a4 100644 (file)
@@ -639,8 +639,7 @@ static int show_patch_diff(struct combine_diff_path *elem, int num_parent,
                        /* deleted file */
                        result_size = 0;
                        elem->mode = 0;
-                       result = xmalloc(1);
-                       result[0] = 0;
+                       result = xcalloc(1, 1);
                }
                if (0 <= fd)
                        close(fd);