Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH 05/10] hotspot: fix multiple potential memory leaks
Date: Wed, 16 Oct 2019 15:29:48 -0700	[thread overview]
Message-ID: <20191016222953.513-5-prestwoj@gmail.com> (raw)
In-Reply-To: <20191016222953.513-1-prestwoj@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1110 bytes --]

---
 src/hotspot.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/hotspot.c b/src/hotspot.c
index 20ebb2fd..1a783958 100644
--- a/src/hotspot.c
+++ b/src/hotspot.c
@@ -342,7 +342,11 @@ static struct hs20_config *hs20_config_new(struct l_settings *settings,
 	config = l_new(struct hs20_config, 1);
 
 	if (hessid_str) {
-		util_string_to_address(hessid_str, config->hessid);
+		if (!util_string_to_address(hessid_str, config->hessid)) {
+			l_error("Invalid HESSID in settings");
+			memset(config->hessid, 0, 6);
+		}
+
 		l_free(hessid_str);
 	}
 
@@ -423,6 +427,8 @@ static void hs20_dir_watch_cb(const char *filename,
 
 		l_queue_push_head(hs20_settings, config);
 
+		l_settings_free(new);
+
 		break;
 	case L_DIR_WATCH_EVENT_REMOVED:
 		config = l_queue_remove_if(hs20_settings, match_filename,
@@ -453,6 +459,8 @@ static void hs20_dir_watch_cb(const char *filename,
 
 		known_network_update(&config->super, new, connected_time);
 
+		l_settings_free(new);
+
 		break;
 	case L_DIR_WATCH_EVENT_ACCESSED:
 		break;
-- 
2.17.1

  parent reply	other threads:[~2019-10-16 22:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-16 22:29 [PATCH 01/10] anqp: fix potential NULL pointer dereference James Prestwood
2019-10-16 22:29 ` [PATCH 02/10] erp: check return of hkdf_expand James Prestwood
2019-10-16 22:29 ` [PATCH 03/10] eap-pwd: fix potential memory leak James Prestwood
2019-10-16 22:29 ` [PATCH 04/10] crypto: " James Prestwood
2019-10-16 22:29 ` James Prestwood [this message]
2019-10-16 23:18   ` [PATCH 05/10] hotspot: fix multiple potential memory leaks Denis Kenzior
2019-10-16 22:29 ` [PATCH 06/10] ie: fix uninitialized rx/tx_nss values James Prestwood
2019-10-16 22:29 ` [PATCH 07/10] owe: check for error return getting shared_secret James Prestwood
2019-10-16 22:29 ` [PATCH 08/10] owe: fix potential double free on error James Prestwood
2019-10-16 22:29 ` [PATCH 09/10] owe: fix potential uninitialized variable James Prestwood
2019-10-16 22:29 ` [PATCH 10/10] sae: check return getting k_point James Prestwood
2019-10-16 23:11 ` [PATCH 01/10] anqp: fix potential NULL pointer dereference Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191016222953.513-5-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox