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:
Thomas Haller 2019-11-27 10:27:00 +01:00
parent 1c2889faee
commit 3ade6dacfc

View file

@ -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);