mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-16 21:40:27 +01:00
ifcfg: fix invalid free in parse_route_line()
Cannot free NM_PTRARRAY_EMPTY(). Discovered by coverity.
Fixes: 6d675a943b
This commit is contained in:
parent
62a57dab49
commit
d0d962d3d1
1 changed files with 4 additions and 4 deletions
|
|
@ -589,7 +589,8 @@ parse_route_line (const char *line,
|
|||
GError **error)
|
||||
{
|
||||
nm_auto_ip_route_unref NMIPRoute *route = NULL;
|
||||
gs_free const char **words = NULL;
|
||||
gs_free const char **words_free = NULL;
|
||||
const char *const*words;
|
||||
const char *s;
|
||||
gsize i_words;
|
||||
guint i;
|
||||
|
|
@ -653,10 +654,9 @@ parse_route_line (const char *line,
|
|||
* Maybe later we want to support some form of quotation here.
|
||||
* Which of course, would be incompatible with initscripts.
|
||||
*/
|
||||
words = nm_utils_strsplit_set (line, " \t\n");
|
||||
words_free = nm_utils_strsplit_set (line, " \t\n");
|
||||
|
||||
if (!words)
|
||||
words = (const char **) NM_PTRARRAY_EMPTY (const char *);
|
||||
words = words_free ?: NM_PTRARRAY_EMPTY (const char *);
|
||||
|
||||
for (i_words = 0; words[i_words]; ) {
|
||||
const gsize i_words0 = i_words;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue