Skip to content

Commit

Permalink
Remove unused return strings
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmundell authored and timopollmeier committed Oct 5, 2023
1 parent 597e9a1 commit fc8525f
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/gsad_gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -5599,7 +5599,6 @@ char *
restore_gmp (gvm_connection_t *connection, credentials_t *credentials,
params_t *params, cmd_response_data_t *response_data)
{
GString *xml;
gchar *ret;
entity_t entity;
const char *target_id;
Expand All @@ -5608,8 +5607,6 @@ restore_gmp (gvm_connection_t *connection, credentials_t *credentials,

CHECK_VARIABLE_INVALID (target_id, "Restore")

xml = g_string_new ("");

/* Restore the resource. */

if (gvm_connection_sendf (connection,
Expand All @@ -5618,7 +5615,6 @@ restore_gmp (gvm_connection_t *connection, credentials_t *credentials,
target_id)
== -1)
{
g_string_free (xml, TRUE);
cmd_response_data_set_status_code (response_data,
MHD_HTTP_INTERNAL_SERVER_ERROR);
return gsad_message (
Expand All @@ -5629,9 +5625,8 @@ restore_gmp (gvm_connection_t *connection, credentials_t *credentials,
response_data);
}

if (read_entity_and_string_c (connection, &entity, &xml))
if (read_entity_and_string_c (connection, &entity, NULL))
{
g_string_free (xml, TRUE);
cmd_response_data_set_status_code (response_data,
MHD_HTTP_INTERNAL_SERVER_ERROR);
return gsad_message (
Expand All @@ -5647,7 +5642,6 @@ restore_gmp (gvm_connection_t *connection, credentials_t *credentials,
ret = response_from_entity (connection, credentials, params, entity,
"Restore", response_data);
free_entity (entity);
g_string_free (xml, FALSE);
return ret;
}

Expand All @@ -5665,17 +5659,13 @@ char *
empty_trashcan_gmp (gvm_connection_t *connection, credentials_t *credentials,
params_t *params, cmd_response_data_t *response_data)
{
GString *xml;
gchar *ret;
entity_t entity;

xml = g_string_new ("");

/* Empty the trash. */

if (gvm_connection_sendf (connection, "<empty_trashcan/>") == -1)
{
g_string_free (xml, TRUE);
cmd_response_data_set_status_code (response_data,
MHD_HTTP_INTERNAL_SERVER_ERROR);
return gsad_message (
Expand All @@ -5685,9 +5675,8 @@ empty_trashcan_gmp (gvm_connection_t *connection, credentials_t *credentials,
response_data);
}

if (read_entity_and_string_c (connection, &entity, &xml))
if (read_entity_and_string_c (connection, &entity, NULL))
{
g_string_free (xml, TRUE);
cmd_response_data_set_status_code (response_data,
MHD_HTTP_INTERNAL_SERVER_ERROR);
return gsad_message (
Expand All @@ -5702,7 +5691,6 @@ empty_trashcan_gmp (gvm_connection_t *connection, credentials_t *credentials,
ret = response_from_entity (connection, credentials, params, entity,
"Empty Trashcan", response_data);
free_entity (entity);
g_string_free (xml, FALSE);
return ret;
}

Expand Down

0 comments on commit fc8525f

Please sign in to comment.