From fe89da38f60b45057ad48d40be2e6ea267bd35a7 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Wed, 5 Apr 1995 22:55:27 +0000 Subject: [PATCH] Sed dumps core when linked with some coalescing malloc because it doesn't initialize malloced structure. Submitted by: vode@hut.fi --- usr.bin/sed/compile.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c index 944a2269b10..b958ff896b9 100644 --- a/usr.bin/sed/compile.c +++ b/usr.bin/sed/compile.c @@ -217,6 +217,8 @@ nonsel: /* Now parse the command */ if (!*p) p = NULL; cmd2 = xmalloc(sizeof(struct s_command)); + cmd2->nonsel = cmd2->inrange = 0; + cmd2->a1 = cmd2->a2 = NULL; cmd2->code = '}'; *compile_stream("}", &cmd->u.c, p) = cmd2; cmd->next = cmd2;