diff options
| author | bloodstalker <thabogre@gmail.com> | 2017-04-02 04:41:05 +0000 | 
|---|---|---|
| committer | bloodstalker <thabogre@gmail.com> | 2017-04-02 04:41:05 +0000 | 
| commit | a9ffad836eafa989b2d4e489fe2d591169b1de8e (patch) | |
| tree | d9b20873d4b5a631f3c968d53173f5ce831be920 | |
| parent | now the server will only run the driver commands. not anything. (diff) | |
| download | mutator-a9ffad836eafa989b2d4e489fe2d591169b1de8e.tar.gz mutator-a9ffad836eafa989b2d4e489fe2d591169b1de8e.zip | |
fixed some issues
Diffstat (limited to '')
| -rw-r--r-- | daemon/daemon_aux.c | 12 | 
1 files changed, 9 insertions, 3 deletions
| diff --git a/daemon/daemon_aux.c b/daemon/daemon_aux.c index 3a78eb6..3572972 100644 --- a/daemon/daemon_aux.c +++ b/daemon/daemon_aux.c @@ -149,11 +149,14 @@ int mutator_server(FILE* log_file)  #endif  #if 1 -    for (int i = 0; i < strlen(temp); ++i) +    if (temp != NULL)      { -      if (i == strlen(temp) - 1) +      for (int i = 0; i < strlen(temp); ++i)        { -        temp[i] = '\0'; +        if (i == strlen(temp) - 1) +        { +          temp[i] = '\0'; +        }        }      }      full_command = malloc(strlen(temp) + strlen(client_message) + strlen(driver_name) + 1); @@ -181,11 +184,14 @@ int mutator_server(FILE* log_file)      {        fprintf(log_file, "%s", "what are you trying to do exactly?");        write(client_sock, BADOUT, strlen(BADOUT)); +      free(full_command); +      fclose(mutator_config);        continue;      }      fprintf(log_file, "%s", "freeing memory reserved for command.\n");      free(full_command); +    fclose(mutator_config);      if (clientistream == NULL)      { | 
