diff options
-rw-r--r-- | libthor/thor_raw_file.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libthor/thor_raw_file.c b/libthor/thor_raw_file.c index e357c68..fa02f28 100644 --- a/libthor/thor_raw_file.c +++ b/libthor/thor_raw_file.c @@ -100,7 +100,7 @@ int t_file_get_data_src(const char *path, struct thor_data_src **data) ret = open(path, O_RDONLY); if (ret < 0) - goto close_file; + goto free_data; fdata->fd = ret; @@ -138,6 +138,7 @@ int t_file_get_data_src(const char *path, struct thor_data_src **data) close_file: close(ret); +free_data: free(fdata); return -EINVAL; } |