-fskeletons-copy


git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@987 59561ff5-6e30-0410-9f3c-9617f08c8826
diff --git a/libasn1compiler/asn1c_compat.c b/libasn1compiler/asn1c_compat.c
index 2a80251..b393d6d 100644
--- a/libasn1compiler/asn1c_compat.c
+++ b/libasn1compiler/asn1c_compat.c
@@ -80,12 +80,19 @@
 	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;