Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/stdlib Remember the correct pointer which we will f...



details:   https://anonhg.NetBSD.org/src/rev/1e1ed8494c67
branches:  trunk
changeset: 757834:1e1ed8494c67
user:      tron <tron%NetBSD.org@localhost>
date:      Sat Sep 25 19:10:37 2010 +0000

description:
Remember the correct pointer which we will free later.

diffstat:

 lib/libc/stdlib/setenv.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 6cf4d484860d -r 1e1ed8494c67 lib/libc/stdlib/setenv.c
--- a/lib/libc/stdlib/setenv.c  Sat Sep 25 18:37:24 2010 +0000
+++ b/lib/libc/stdlib/setenv.c  Sat Sep 25 19:10:37 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: setenv.c,v 1.36 2010/09/25 18:11:40 tron Exp $ */
+/*     $NetBSD: setenv.c,v 1.37 2010/09/25 19:10:37 tron Exp $ */
 
 /*
  * Copyright (c) 1987, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)setenv.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: setenv.c,v 1.36 2010/09/25 18:11:40 tron Exp $");
+__RCSID("$NetBSD: setenv.c,v 1.37 2010/09/25 19:10:37 tron Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -118,7 +118,7 @@
        *c++ = '=';
 
        free(__environ_malloced[offset]);
-       __environ_malloced[offset] = c;
+       __environ_malloced[offset] = environ[offset];
 
 copy:
        (void)memcpy(c, value, l_value + 1);



Home | Main Index | Thread Index | Old Index