aboutsummaryrefslogtreecommitdiff
path: root/pass.c
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2023-12-30 18:15:49 +0530
committersinanmohd <sinan@sinanmohd.com>2023-12-30 18:15:49 +0530
commit45daa3e2ea35cb92b5708104ce0da24249435feb (patch)
tree500ac6c96968123196cf13bd3b8fb39189417d47 /pass.c
parenta042114987129a32c7d7d3243a46e0dfd00b13b2 (diff)
pass.c: if allocation fails don't check for NULL and free
Diffstat (limited to 'pass.c')
-rw-r--r--pass.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/pass.c b/pass.c
index b66e2ac..7c4d864 100644
--- a/pass.c
+++ b/pass.c
@@ -64,8 +64,6 @@ int add(const char *path)
if (r < 0) {
if (in != stdin)
fclose(in);
- if (p1)
- free(p1);
err_die(1, "%d:%s:", errno, strerror(errno));
}
@@ -75,10 +73,8 @@ int add(const char *path)
if (r < 0) {
if (in != stdin)
fclose(in);
- if (p2)
+ if (p1)
free(p1);
- if (p2)
- free(p2);
err_die(1, "%d:%s:", errno, strerror(errno));
}