{
cmd_len++; // account for \n in the end
cmd = malloc (cmd_len);
+ if (!cmd)
+ {
+ error = errno;
+ perror ("malloc failed");
+ goto done;
+ }
+ memset (cmd, 0, cmd_len);
while (argc--)
{
strncat (cmd, *argv++, cmd_len);
close (sock_fd);
done:
+ free (cmd);
if (efd > -1)
close (efd);