diff options
author | sinanmohd <sinan@sinanmohd.com> | 2024-08-25 16:50:22 +0530 |
---|---|---|
committer | sinanmohd <sinan@sinanmohd.com> | 2024-08-25 16:51:29 +0530 |
commit | 2dd578cfde8f03c0bd2062a76bbc72ec7d5b4e22 (patch) | |
tree | 7207f36e733002644f4425fe37ed49f6dc59dfaf /src/evanix.c | |
parent | 62b91f57e1a16becd95a5ae4575c42e878e19723 (diff) |
evanix/opts_read: only clean up on error
Diffstat (limited to 'src/evanix.c')
-rw-r--r-- | src/evanix.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/evanix.c b/src/evanix.c index b4852bb..da517b0 100644 --- a/src/evanix.c +++ b/src/evanix.c @@ -337,12 +337,12 @@ static int opts_read(struct evanix_opts_t *opts, char **expr, int argc, } out_free_evanix: - if (ret != 0) + if (ret < 0) evanix_free(opts); else *expr = argv[optind]; - return ret; + return ret < 0 ? ret : 0; } static int evanix_free(struct evanix_opts_t *opts) |