summaryrefslogtreecommitdiffhomepage
path: root/mixlib/mix_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'mixlib/mix_file.c')
-rw-r--r--mixlib/mix_file.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/mixlib/mix_file.c b/mixlib/mix_file.c
index 45d45e0..9b79eef 100644
--- a/mixlib/mix_file.c
+++ b/mixlib/mix_file.c
@@ -48,14 +48,12 @@ open_file_(const gchar *name, mix_fmode_t mode)
mix_file_t *result;
FILE *file;
- file = fopen(name, fmode_to_type_(mode));
- if ( file == NULL ) return NULL;
result = g_new(mix_file_t, 1);
- if ( result == NULL )
- {
- fclose(file);
- return NULL;
- }
+ file = fopen(name, fmode_to_type_(mode));
+ if ( file == NULL ) {
+ g_free (result);
+ return NULL;
+ }
io_init_from_file_(MIX_IOCHANNEL(result), file);
return result;
}