mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-24 19:30:38 +01:00
dispatcher: use free() to free memory allocated with malloc()
In practice, nowadays g_free() is the same as free(), so there is no difference. However, we still should not mix the two and use free() for data that was allocated with malloc() -- in this case, the memory was allocated by libc's realpath().
This commit is contained in:
parent
1c2889faee
commit
3ade6dacfc
1 changed files with 5 additions and 4 deletions
|
|
@ -638,14 +638,15 @@ static gboolean
|
|||
script_must_wait (const char *path)
|
||||
{
|
||||
gs_free char *link = NULL;
|
||||
gs_free char *dir = NULL;
|
||||
gs_free char *real = NULL;
|
||||
char *tmp;
|
||||
|
||||
|
||||
link = g_file_read_link (path, NULL);
|
||||
if (link) {
|
||||
gs_free char *dir = NULL;
|
||||
nm_auto_free char *real = NULL;
|
||||
|
||||
if (!g_path_is_absolute (link)) {
|
||||
char *tmp;
|
||||
|
||||
dir = g_path_get_dirname (path);
|
||||
tmp = g_build_path ("/", dir, link, NULL);
|
||||
g_free (link);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue