Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/patch Fix memory leak



details:   https://anonhg.NetBSD.org/src/rev/02b8afddb457
branches:  trunk
changeset: 376420:02b8afddb457
user:      wiz <wiz%NetBSD.org@localhost>
date:      Fri Jun 16 23:36:26 2023 +0000

description:
Fix memory leak

CVS: ----------------------------------------------------------------------
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use "PR category/123" to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: => For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: => If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: => If the change is major:
CVS: => If the change adds files to, or removes files from $DESTDIR:
CVS: => If you are changing a library or kernel interface:
CVS: Have you successfully run "./build.sh release"?

diffstat:

 usr.bin/patch/inp.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 3c1b77882269 -r 02b8afddb457 usr.bin/patch/inp.c
--- a/usr.bin/patch/inp.c       Fri Jun 16 23:32:37 2023 +0000
+++ b/usr.bin/patch/inp.c       Fri Jun 16 23:36:26 2023 +0000
@@ -1,7 +1,7 @@
 /*
  * $OpenBSD: inp.c,v 1.34 2006/03/11 19:41:30 otto Exp $
  * $DragonFly: src/usr.bin/patch/inp.c,v 1.6 2007/09/29 23:11:10 swildner Exp $
- * $NetBSD: inp.c,v 1.29 2023/06/16 23:32:37 wiz Exp $
+ * $NetBSD: inp.c,v 1.30 2023/06/16 23:36:26 wiz Exp $
  */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: inp.c,v 1.29 2023/06/16 23:32:37 wiz Exp $");
+__RCSID("$NetBSD: inp.c,v 1.30 2023/06/16 23:36:26 wiz Exp $");
 
 #include <sys/types.h>
 #include <sys/file.h>
@@ -271,6 +271,7 @@ plan_a(const char *filename)
                } else if (statfailed) {
                        fatal("can't find %s\n", filename);
                }
+               free(lbuf);
                free(tmp_filename1);
                free(tmp_filename2);
        }



Home | Main Index | Thread Index | Old Index