test two generated mallocs for success
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9577 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997 - 2000 Kungliga Tekniska H<>gskolan
|
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
|
||||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -131,7 +131,8 @@ decode_type (const char *name, const Type *t)
|
|||||||
if (0 && m->type->type == TType){
|
if (0 && m->type->type == TType){
|
||||||
if(m->optional)
|
if(m->optional)
|
||||||
fprintf (codefile,
|
fprintf (codefile,
|
||||||
"%s = malloc(sizeof(*%s));\n", s, s);
|
"%s = malloc(sizeof(*%s));\n"
|
||||||
|
"if(%s == NULL) return ENOMEM;\n", s, s, s);
|
||||||
fprintf (codefile,
|
fprintf (codefile,
|
||||||
"e = decode_seq_%s(p, len, %d, %d, %s, &l);\n",
|
"e = decode_seq_%s(p, len, %d, %d, %s, &l);\n",
|
||||||
m->type->symbol->gen_name,
|
m->type->symbol->gen_name,
|
||||||
@@ -179,8 +180,8 @@ decode_type (const char *name, const Type *t)
|
|||||||
"return ASN1_BAD_FORMAT;\n");
|
"return ASN1_BAD_FORMAT;\n");
|
||||||
if (m->optional)
|
if (m->optional)
|
||||||
fprintf (codefile,
|
fprintf (codefile,
|
||||||
"%s = malloc(sizeof(*%s));\n",
|
"%s = malloc(sizeof(*%s));\n"
|
||||||
s, s);
|
"if(%s == NULL) return ENOMEM;\n", s, s, s);
|
||||||
decode_type (s, m->type);
|
decode_type (s, m->type);
|
||||||
fprintf (codefile,
|
fprintf (codefile,
|
||||||
"if(dce_fix){\n"
|
"if(dce_fix){\n"
|
||||||
|
Reference in New Issue
Block a user