=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/patch/util.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- src/usr.bin/patch/util.c 2009/10/27 23:59:41 1.33 +++ src/usr.bin/patch/util.c 2010/01/08 13:27:59 1.34 @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.33 2009/10/27 23:59:41 deraadt Exp $ */ +/* $OpenBSD: util.c,v 1.34 2010/01/08 13:27:59 oga Exp $ */ /* * patch - a program to apply diffs to original files @@ -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)