summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/simfs.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/simfs.c b/src/simfs.c
index 7a9ecc53..2ac1a4f2 100644
--- a/src/simfs.c
+++ b/src/simfs.c
@@ -491,18 +491,17 @@ static void sim_fs_op_info_cb(const struct ofono_error *error, int length,
goto out;
fs->fd = TFR(open(path, O_RDWR | O_CREAT | O_TRUNC, SIM_CACHE_MODE));
+ g_free(path);
if (fs->fd == -1)
- goto out;
+ return;
- if (TFR(write(fs->fd, fileinfo, SIM_CACHE_HEADER_SIZE)) !=
- SIM_CACHE_HEADER_SIZE) {
- TFR(close(fs->fd));
- fs->fd = -1;
- }
+ if (TFR(write(fs->fd, fileinfo, SIM_CACHE_HEADER_SIZE)) ==
+ SIM_CACHE_HEADER_SIZE)
+ return;
-out:
- g_free(path);
+ TFR(close(fs->fd));
+ fs->fd = -1;
}
static gboolean sim_fs_op_check_cached(struct sim_fs *fs)