diff options
| author | Michael Biebl <biebl@debian.org> | 2024-08-26 16:10:46 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2024-08-26 16:10:46 +0200 |
| commit | 3a978cdfcd31e6b5ef23de1a17cebc1f0553a843 (patch) | |
| tree | 2924c74e3d8fa38843752f74409aa4c36617b738 /src/nmcli | |
| parent | 1908b552d07c2dad7e1ee92fbf39db3b0a952cb7 (diff) | |
| parent | 681dfc70ef98f6ed0c05bcb0fbff00e3fc0799ea (diff) | |
Update upstream source from tag 'upstream/1.48.10'
Update to upstream version '1.48.10' with Debian dir 25cc9dccbfe61f58ec876b75cd5e7309e1c28f5d
Diffstat (limited to 'src/nmcli')
| -rw-r--r-- | src/nmcli/connections.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/nmcli/connections.c b/src/nmcli/connections.c index 9eac7b9a..7e192388 100644 --- a/src/nmcli/connections.c +++ b/src/nmcli/connections.c @@ -6576,8 +6576,15 @@ extract_setting_and_property(const char *prompt, const char *line, char **settin p2 = dot + 1; num1 = strcspn(p1, "."); num2 = len > num1 + 1 ? len - num1 - 1 : 0; - sett = num1 > 0 ? g_strndup(p1, num1) : sett; - prop = num2 > 0 ? g_strndup(p2, num2) : prop; + if (num1 > 0) { + g_free(sett); + sett = g_strndup(p1, num1); + } + + if (num2 > 0) { + g_free(prop); + prop = g_strndup(p2, num2); + } } else { if (!prop) prop = len > 0 ? g_strndup(p1, len) : NULL; |