Skip to content

Commit

Permalink
Fix: memory leaks in ipc_openvas.c
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnicola committed Oct 21, 2022
1 parent f55c05c commit 5e1e612
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions misc/ipc_openvas.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,15 @@ ipc_data_from_json (const char *json, size_t len)
goto cleanup;
if (!json_reader_read_member (reader, "hostname"))
{
g_free (hn);
goto cleanup;
}
hn->hostname = g_strdup (json_reader_get_string_value (reader));
hn->hostname_len = strlen (hn->hostname);
json_reader_end_member (reader);
if (!json_reader_read_member (reader, "source"))
{
ipc_hostname_destroy (hn);
goto cleanup;
}
hn->source = g_strdup (json_reader_get_string_value (reader));
Expand All @@ -391,6 +393,7 @@ ipc_data_from_json (const char *json, size_t len)
goto cleanup;
if (!json_reader_read_member (reader, "user-agent"))
{
g_free (ua);
goto cleanup;
}
ua->user_agent = g_strdup (json_reader_get_string_value (reader));
Expand Down

0 comments on commit 5e1e612

Please sign in to comment.