aboutsummaryrefslogtreecommitdiffstats
path: root/libasn1compiler/asn1c_compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'libasn1compiler/asn1c_compat.c')
-rw-r--r--libasn1compiler/asn1c_compat.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libasn1compiler/asn1c_compat.c b/libasn1compiler/asn1c_compat.c
index 2a80251a..b393d6d2 100644
--- a/libasn1compiler/asn1c_compat.c
+++ b/libasn1compiler/asn1c_compat.c
@@ -80,12 +80,19 @@ asn1c_open_file(const char *name, const char *ext, char **opt_tmpname) {
if(fp == NULL) {
if(created) unlink(fname);
close(fd);
+ return NULL;
}
/* Return the temporary file name */
if(opt_tmpname) {
*opt_tmpname = strdup(fname);
- assert(*opt_tmpname);
+ if(*opt_tmpname) {
+ /* Successfull */
+ } else {
+ if(created) unlink(fname);
+ fclose(fp);
+ return NULL;
+ }
}
return fp;