summaryrefslogtreecommitdiff
path: root/lib/libcrypto/conf/conf_def.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-05-30 06:22:58 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-05-30 06:22:58 +0000
commit92fe7f51d198ea62cc552bf356ca8d58fa48417f (patch)
treeb9cbba44945fc3ef0c4bbbd4778edfff3328f155 /lib/libcrypto/conf/conf_def.c
parent5e5527b3e65377286505a3ba5f9a7f0fa64f00f1 (diff)
more: no need for null check before free
ok tedu guenther
Diffstat (limited to 'lib/libcrypto/conf/conf_def.c')
-rw-r--r--lib/libcrypto/conf/conf_def.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/libcrypto/conf/conf_def.c b/lib/libcrypto/conf/conf_def.c
index b3c75e1a9e5..b550623e57c 100644
--- a/lib/libcrypto/conf/conf_def.c
+++ b/lib/libcrypto/conf/conf_def.c
@@ -416,15 +416,13 @@ again:
}
if (buff != NULL)
BUF_MEM_free(buff);
- if (section != NULL)
- free(section);
+ free(section);
return (1);
err:
if (buff != NULL)
BUF_MEM_free(buff);
- if (section != NULL)
- free(section);
+ free(section);
if (line != NULL)
*line = eline;
ERR_asprintf_error_data("line %ld", eline);
@@ -433,12 +431,9 @@ err:
conf->data = NULL;
}
if (v != NULL) {
- if (v->name != NULL)
- free(v->name);
- if (v->value != NULL)
- free(v->value);
- if (v != NULL)
- free(v);
+ free(v->name);
+ free(v->value);
+ free(v);
}
return (0);
}
@@ -615,8 +610,7 @@ str_copy(CONF *conf, char *section, char **pto, char *from)
buf->data[to++] = *(from++);
}
buf->data[to]='\0';
- if (*pto != NULL)
- free(*pto);
+ free(*pto);
*pto = buf->data;
free(buf);
return (1);