diff options
author | jaortega <jaortega> | 2000-12-01 23:35:35 +0000 |
---|---|---|
committer | jaortega <jaortega> | 2000-12-01 23:35:35 +0000 |
commit | 99cc30339d9cb98b240a6e0ef59c333fe3194018 (patch) | |
tree | 925888afb5390b55b38345846b5a06084c92de35 /mixlib/mix_file.c | |
parent | 6861d82f0bca390a95609d548146f6629bde264f (diff) | |
download | mdk-99cc30339d9cb98b240a6e0ef59c333fe3194018.tar.gz mdk-99cc30339d9cb98b240a6e0ef59c333fe3194018.tar.bz2 |
removed checks for null pointer after g_new ()
Diffstat (limited to 'mixlib/mix_file.c')
-rw-r--r-- | mixlib/mix_file.c | 12 |
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; } |