Author: jilles Date: Fri Apr 18 12:34:10 2014 New Revision: 264643 URL: http://svnweb.freebsd.org/changeset/base/264643
Log: MFC r263846: sh: Fix memory leak when trying to set a read only variable. Modified: stable/9/bin/sh/var.c Directory Properties: stable/9/bin/sh/ (props changed) Modified: stable/9/bin/sh/var.c ============================================================================== --- stable/9/bin/sh/var.c Fri Apr 18 08:31:55 2014 (r264642) +++ stable/9/bin/sh/var.c Fri Apr 18 12:34:10 2014 (r264643) @@ -339,8 +339,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; _______________________________________________ svn-src-stable-9@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"