Skip to content

Commit da162b5

Browse files
lnykrynjamacku
authored andcommitted
rename_device: free path after it is used
(cherry picked from commit 2b185d6) Resolves: RHEL-28191
1 parent 2857db0 commit da162b5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/rename_device.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ struct netdev *get_configs() {
180180
return ret;
181181
}
182182
for (x = 0; x < ncfgs; x++ ) {
183-
char *path;
183+
char *path = NULL;
184184
char *devname, *hwaddr;
185185
int vlan;
186186
gchar *contents, **lines;
@@ -193,6 +193,7 @@ struct netdev *get_configs() {
193193
cfgs[x]->d_name) == -1)
194194
continue;
195195
g_file_get_contents(path, &contents, NULL, NULL);
196+
free(path);
196197
if (!contents)
197198
continue;
198199
lines = g_strsplit(contents,"\n", 0);

0 commit comments

Comments
 (0)