=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/awk/run.c,v retrieving revision 1.72 retrieving revision 1.73 diff -c -r1.72 -r1.73 *** src/usr.bin/awk/run.c 2022/06/03 19:40:56 1.72 --- src/usr.bin/awk/run.c 2022/09/01 15:21:28 1.73 *************** *** 1,4 **** ! /* $OpenBSD: run.c,v 1.72 2022/06/03 19:40:56 millert Exp $ */ /**************************************************************** Copyright (C) Lucent Technologies 1997 All Rights Reserved --- 1,4 ---- ! /* $OpenBSD: run.c,v 1.73 2022/09/01 15:21:28 millert Exp $ */ /**************************************************************** Copyright (C) Lucent Technologies 1997 All Rights Reserved *************** *** 972,979 **** } *p = '\0'; free(fmt); ! for ( ; a; a = a->nnext) /* evaluate any remaining args */ ! execute(a); *pbuf = buf; *pbufsize = bufsize; return p - buf; --- 972,981 ---- } *p = '\0'; free(fmt); ! for ( ; a; a = a->nnext) { /* evaluate any remaining args */ ! x = execute(a); ! tempfree(x); ! } *pbuf = buf; *pbufsize = bufsize; return p - buf; *************** *** 1269,1274 **** --- 1271,1277 ---- origs = s = strdup(getsval(y)); if (s == NULL) FATAL("out of space in split"); + tempfree(y); arg3type = ptoi(a[3]); if (a[2] == NULL) /* fs string */ fs = getsval(fsloc); *************** *** 1391,1397 **** } } tempfree(ap); - tempfree(y); xfree(origs); xfree(origfs); x = gettemp(); --- 1394,1399 ---- *************** *** 1836,1843 **** setfval(x, u); if (nextarg != NULL) { WARNING("warning: function has too many arguments"); ! for ( ; nextarg; nextarg = nextarg->nnext) ! execute(nextarg); } return(x); } --- 1838,1847 ---- setfval(x, u); if (nextarg != NULL) { WARNING("warning: function has too many arguments"); ! for ( ; nextarg; nextarg = nextarg->nnext) { ! y = execute(nextarg); ! tempfree(y); ! } } return(x); }