diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-07-31 09:43:24 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-07-31 09:43:24 +0200 |
commit | 02acb1d4f00648b3ececd8fee2dc065f868e432e (patch) | |
tree | 43cfc9e8c944c75d2d6223551cbbb2bfa91cb5fa /sys/src/cmd/mothra/forms.c | |
parent | a5d30a3d043c099bec912134c53c8d47a0ff7850 (diff) |
mothra: make emalloc zero memory, fix uninitialized nextline pointer crash
Diffstat (limited to 'sys/src/cmd/mothra/forms.c')
-rw-r--r-- | sys/src/cmd/mothra/forms.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/src/cmd/mothra/forms.c b/sys/src/cmd/mothra/forms.c index f3ca17af0..aa5a89056 100644 --- a/sys/src/cmd/mothra/forms.c +++ b/sys/src/cmd/mothra/forms.c @@ -72,7 +72,7 @@ char *selgen(Panel *, int); char *nullgen(Panel *, int); Field *newfield(Form *form){ Field *f; - f=emallocz(sizeof(Field), 1); + f=emalloc(sizeof(Field)); if(form->efields==0) form->fields=f; else @@ -99,7 +99,7 @@ void rdform(Hglob *g){ htmlerror(g->name, g->lineno, "nested forms illegal\n"); break; } - g->form=emallocz(sizeof(Form), 1); + g->form=emalloc(sizeof(Form)); s=pl_getattr(g->attr, "action"); g->form->action=strdup((s && s[0]) ? s : g->dst->url->fullname); s=pl_getattr(g->attr, "method"); @@ -223,7 +223,7 @@ void rdform(Hglob *g){ if((f=g->form->efields)==0) goto BadTag; if(f->size<8) f->size++; - o=emallocz(sizeof(Option), 1); + o=emalloc(sizeof(Option)); for(op=&f->options;*op;op=&(*op)->next); *op=o; o->next=0; |