Wireless Daemon for Linux
 help / color / mirror / Atom feed
* [PATCH 1/3] storage: Refactor dirs creation logic to cleanup on failure
@ 2020-04-09  1:44 Tim Kourt
  2020-04-09  1:44 ` [PATCH 2/3] main: Fix failure cleanup sequence Tim Kourt
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tim Kourt @ 2020-04-09  1:44 UTC (permalink / raw)
  To: iwd

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

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

diff --git a/src/storage.c b/src/storage.c
index a075d31d..00d93933 100644
--- a/src/storage.c
+++ b/src/storage.c
@@ -200,16 +200,24 @@ bool storage_create_dirs(void)
 	}
 
 	storage_path = l_strdup(state_dirs[0]);
-	storage_hotspot_path = l_strdup_printf("%s/hotspot/", state_dirs[0]);
 	l_strv_free(state_dirs);
 
 	if (create_dirs(storage_path)) {
 		l_error("Failed to create %s", storage_path);
+
+		l_free(storage_path);
+
 		return false;
 	}
 
+	storage_hotspot_path = l_strdup_printf("%s/hotspot/", storage_path);
+
 	if (create_dirs(storage_hotspot_path)) {
 		l_error("Failed to create %s", storage_hotspot_path);
+
+		l_free(storage_path);
+		l_free(storage_hotspot_path);
+
 		return false;
 	}
 
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-09 15:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-09  1:44 [PATCH 1/3] storage: Refactor dirs creation logic to cleanup on failure Tim Kourt
2020-04-09  1:44 ` [PATCH 2/3] main: Fix failure cleanup sequence Tim Kourt
2020-04-09  1:44 ` [PATCH 3/3] main: Simplify config file search logic Tim Kourt
2020-04-09 15:41 ` [PATCH 1/3] storage: Refactor dirs creation logic to cleanup on failure Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox