Previously, when gnutls-serv was executed with the --echo option, it
would exit when a message to be echoed was received. Moreover, the
server would output "Memory error" although no error occurred.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
*response_length = strlen(*response);
return 1;
} else if (ret == 0) {
+ *response = strdup(request);
if (*response == NULL) {
fprintf(stderr, "Memory error\n");
return 0;
}
- *response = strdup(request);
- *response_length = ((*response) ? strlen(*response) : 0);
+ *response_length = strlen(*response);
} else {
*response = NULL;
do {