Skip to contentSkip to conversation

network: use L_AUTO_FREE_VAR

PATCH In review Marc-Antoine Perennou 2 participants 2 messages May 14, 2021 – May 17, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 network: use L_AUTO_FREE_VAR

---
 src/network.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/network.c +2 -2
index 9e858663..0eb3687e 100644
@@ -380,10 +380,10 @@ static int network_load_psk(struct network *network, bool need_passphrase)
 	size_t psk_len;
 	uint8_t *psk = l_settings_get_bytes(network->settings, "Security",
 						"PreSharedKey", &psk_len);
-	_auto_(l_free) char *passphrase =
+	L_AUTO_FREE_VAR(char *, passphrase) =
 			l_settings_get_string(network->settings,
 						"Security", "Passphrase");
-	_auto_(l_free) char *path =
+	L_AUTO_FREE_VAR(char *, path) =
 		storage_get_network_file_path(security, ssid);
 	int r;
 
Signature · 1 line
2.30.0
#1 lore raw

Hi Marc-Antoine,

Quoted 13 lines · Marc-Antoine Perennou
---
  src/network.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
src/network.c +0 -0
index 9e858663..0eb3687e 100644
@@ -380,10 +380,10 @@ static int network_load_psk(struct network *network, bool need_passphrase)
  	size_t psk_len;
  	uint8_t *psk = l_settings_get_bytes(network->settings, "Security",

src/network.c static int network_load_psk(struct network *network, bool need_passphrase) · line 389

Quoted 10 lines
src/network.c +2 -2
  						"PreSharedKey", &psk_len);
-	_auto_(l_free) char *passphrase =
+	L_AUTO_FREE_VAR(char *, passphrase) =
  			l_settings_get_string(network->settings,
  						"Security", "Passphrase");
-	_auto_(l_free) char *path =
+	L_AUTO_FREE_VAR(char *, path) =
  		storage_get_network_file_path(security, ssid);
  	int r;
 

Was this supposed to be part of a different set? Can you resend the entire series, it isn't quite clear to me where you're going with this?

I would guess your intent is to use _auto_ with destructors only and fall back to L_AUTO_FREE_VAR for l_free?

Regards,
-Denis