--- gsa-7.0.3/src/gsad_omp.c 2018-03-28 16:23:57.000000000 +0300 +++ gsa-7.0.3/src/gsad_omp.c 2019-02-02 03:12:16.617046562 +0300 @@ -7737,16 +7738,21 @@ g_string_append (xml, command_escaped); g_free (command_escaped); + response = NULL; ret = omp (connection, credentials, &response, &entity, response_data, command->str); g_string_free (command, TRUE); + + if (ret) + { + free_entity (entity); + g_string_free (xml, TRUE); + } + switch (ret) { case 0: break; - case -1: - /* 'omp' set response. */ - return response; case 1: response_data->http_status_code = MHD_HTTP_INTERNAL_SERVER_ERROR; return gsad_message (credentials, @@ -7770,10 +7776,14 @@ "/omp?cmd=get_tasks", response_data); } + if (omp_success (entity) == 0) + set_http_status_from_entity (entity, response_data); g_string_append (xml, response); g_string_append (xml, ""); + free_entity (entity); + g_free (response); return xsl_transform_omp (connection, credentials, params, g_string_free (xml, FALSE), response_data); }