diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2015-12-03 11:46:26 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2015-12-03 11:46:26 +0000 |
commit | 5d1cc1f2e49619d168b935c6595ad7107ec10136 (patch) | |
tree | ce3308b76a4380ec20b376bec6fdf7278e4e4919 /usr.sbin/httpd/server_http.c | |
parent | e7a2dcbf50908ca990c15fb8c4c872f6c6abe488 (diff) |
Remove unnecessary NULL checks before free().
From Jan Schreiber
Diffstat (limited to 'usr.sbin/httpd/server_http.c')
-rw-r--r-- | usr.sbin/httpd/server_http.c | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/usr.sbin/httpd/server_http.c b/usr.sbin/httpd/server_http.c index d8cf256be9e..fdf39f3cd63 100644 --- a/usr.sbin/httpd/server_http.c +++ b/usr.sbin/httpd/server_http.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server_http.c,v 1.101 2015/10/13 08:33:06 sunil Exp $ */ +/* $OpenBSD: server_http.c,v 1.102 2015/12/03 11:46:25 reyk Exp $ */ /* * Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org> @@ -102,26 +102,18 @@ server_httpdesc_free(struct http_descriptor *desc) { if (desc == NULL) return; - if (desc->http_path != NULL) { - free(desc->http_path); - desc->http_path = NULL; - } - if (desc->http_path_alias != NULL) { - free(desc->http_path_alias); - desc->http_path_alias = NULL; - } - if (desc->http_query != NULL) { - free(desc->http_query); - desc->http_query = NULL; - } - if (desc->http_version != NULL) { - free(desc->http_version); - desc->http_version = NULL; - } - if (desc->http_host != NULL) { - free(desc->http_host); - desc->http_host = NULL; - } + + free(desc->http_path); + desc->http_path = NULL; + free(desc->http_path_alias); + desc->http_path_alias = NULL; + free(desc->http_query); + desc->http_query = NULL; + free(desc->http_version); + desc->http_version = NULL; + free(desc->http_host); + desc->http_host = NULL; + kv_purge(&desc->http_headers); desc->http_lastheader = NULL; desc->http_method = 0; |