svn commit: r264512 - stable/10/bin/sh
Jilles Tjoelker
jilles at FreeBSD.org
Tue Apr 15 18:24:25 UTC 2014
Author: jilles
Date: Tue Apr 15 18:24:24 2014
New Revision: 264512
URL: http://svnweb.freebsd.org/changeset/base/264512
Log:
MFC r263846: sh: Fix memory leak when trying to set a read only variable.
Modified:
stable/10/bin/sh/var.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/bin/sh/var.c
==============================================================================
--- stable/10/bin/sh/var.c Tue Apr 15 17:52:22 2014 (r264511)
+++ stable/10/bin/sh/var.c Tue Apr 15 18:24:24 2014 (r264512)
@@ -325,8 +325,11 @@ setvareq(char *s, int flags)
mklocal(s);
vp = find_var(s, &vpp, &nlen);
if (vp != NULL) {
- if (vp->flags & VREADONLY)
+ if (vp->flags & VREADONLY) {
+ if ((flags & (VTEXTFIXED|VSTACK)) == 0)
+ ckfree(s);
error("%.*s: is read only", vp->name_len, s);
+ }
if (flags & VNOSET)
return;
INTOFF;
More information about the svn-src-all
mailing list