Skip to content
Snippets Groups Projects
Unverified Commit 70bd6cb9 authored by Jan Rybar's avatar Jan Rybar Committed by GitHub
Browse files

Static analysis findng - 'buf' can go out of scope (#464)

parent b364bf12
No related branches found
No related tags found
No related merge requests found
...@@ -172,13 +172,14 @@ utils_child_watch_cb (GPid pid, ...@@ -172,13 +172,14 @@ utils_child_watch_cb (GPid pid,
if (g_io_channel_read_to_end (data->child_stdout_channel, &buf, &buf_size, NULL) == G_IO_STATUS_NORMAL) if (g_io_channel_read_to_end (data->child_stdout_channel, &buf, &buf_size, NULL) == G_IO_STATUS_NORMAL)
{ {
g_string_append_len (data->child_stdout, buf, buf_size); g_string_append_len (data->child_stdout, buf, buf_size);
g_free (buf);
} }
g_free (buf);
if (g_io_channel_read_to_end (data->child_stderr_channel, &buf, &buf_size, NULL) == G_IO_STATUS_NORMAL) if (g_io_channel_read_to_end (data->child_stderr_channel, &buf, &buf_size, NULL) == G_IO_STATUS_NORMAL)
{ {
g_string_append_len (data->child_stderr, buf, buf_size); g_string_append_len (data->child_stderr, buf, buf_size);
g_free (buf);
} }
g_free (buf);
data->exit_status = status; data->exit_status = status;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment