summaryrefslogtreecommitdiff
path: root/btt/bno_dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'btt/bno_dump.c')
-rw-r--r--btt/bno_dump.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/btt/bno_dump.c b/btt/bno_dump.c
index 02f3811..00c9ac2 100644
--- a/btt/bno_dump.c
+++ b/btt/bno_dump.c
@@ -31,9 +31,10 @@ static FILE *bno_dump_open(struct d_info *dip, char rwc)
oname = malloc(strlen(bno_dump_name) + strlen(dip->dip_name) + 32);
sprintf(oname, "%s_%s_%c.dat", bno_dump_name, dip->dip_name, rwc);
- if ((fp = my_fopen(oname, "w")) == NULL)
+ if ((fp = my_fopen(oname, "w")) == NULL) {
perror(oname);
- else
+ free(oname);
+ } else
add_file(fp, oname);
return fp;
}