aboutsummaryrefslogtreecommitdiff
path: root/src/evanix.c
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-08-25 16:50:22 +0530
committersinanmohd <sinan@sinanmohd.com>2024-08-25 16:51:29 +0530
commit2dd578cfde8f03c0bd2062a76bbc72ec7d5b4e22 (patch)
tree7207f36e733002644f4425fe37ed49f6dc59dfaf /src/evanix.c
parent62b91f57e1a16becd95a5ae4575c42e878e19723 (diff)
evanix/opts_read: only clean up on error
Diffstat (limited to 'src/evanix.c')
-rw-r--r--src/evanix.c4
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)