Hello, t...@.

tmpbuf is allocated via strdup(3) but it is leaved unfreed when we
leave makedirs() function.

Index: util.c
===================================================================
RCS file: /OpenBSD/src/usr.bin/patch/util.c,v
retrieving revision 1.33
diff -u -r1.33 util.c
--- util.c      27 Oct 2009 23:59:41 -0000      1.33
+++ util.c      7 Jan 2010 21:42:11 -0000
@@ -310,8 +310,10 @@

        if (striplast) {
                char    *s = strrchr(tmpbuf, '/');
-               if (s == NULL)
+               if (s == NULL) {
+                       free(tmpbuf);
                        return; /* nothing to be done */
+               }
                *s = '\0';
        }
        if (mkpath(tmpbuf) != 0)

Reply via email to