Skip to content

Commit

Permalink
rename_device: free path after it is used
Browse files Browse the repository at this point in the history
  • Loading branch information
lnykryn authored and mergify[bot] committed Mar 6, 2024
1 parent f307906 commit 2b185d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rename_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ struct netdev *get_configs() {
return ret;
}
for (x = 0; x < ncfgs; x++ ) {
char *path;
char *path = NULL;
char *devname, *hwaddr;
int vlan;
gchar *contents, **lines;
Expand All @@ -193,6 +193,7 @@ struct netdev *get_configs() {
cfgs[x]->d_name) == -1)
continue;
g_file_get_contents(path, &contents, NULL, NULL);
free(path);
if (!contents)
continue;
lines = g_strsplit(contents,"\n", 0);
Expand Down

0 comments on commit 2b185d6

Please sign in to comment.