Source-Changes-HG archive

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

[src/trunk]: src/bin/pax Free pt in another error case.



details:   https://anonhg.NetBSD.org/src/rev/5e780adbe3cd
branches:  trunk
changeset: 750227:5e780adbe3cd
user:      wiz <wiz%NetBSD.org@localhost>
date:      Mon Dec 21 09:17:37 2009 +0000

description:
Free pt in another error case.
Found by Henning Petersen using cppcheck, in PR 42488.

diffstat:

 bin/pax/sel_subs.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r dc312b7fca18 -r 5e780adbe3cd bin/pax/sel_subs.c
--- a/bin/pax/sel_subs.c        Mon Dec 21 08:42:39 2009 +0000
+++ b/bin/pax/sel_subs.c        Mon Dec 21 09:17:37 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sel_subs.c,v 1.21 2007/04/29 20:23:34 msaitoh Exp $    */
+/*     $NetBSD: sel_subs.c,v 1.22 2009/12/21 09:17:37 wiz Exp $        */
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)sel_subs.c 8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: sel_subs.c,v 1.21 2007/04/29 20:23:34 msaitoh Exp $");
+__RCSID("$NetBSD: sel_subs.c,v 1.22 2009/12/21 09:17:37 wiz Exp $");
 #endif
 #endif /* not lint */
 
@@ -404,6 +404,7 @@
                        default:
                                tty_warn(1, "Bad option %c with time range %s",
                                    *flgpt, str);
+                               (void)free((char *)pt);
                                goto out;
                        }
                        ++flgpt;



Home | Main Index | Thread Index | Old Index