Based on your code, ssock
is an integer, a file descriptor, since you are passing it to close()
in the default case (parent).
However, you are also passing that integer as a character pointer to execve
in the argument list (in the child case). It is unlikely that such an integer will map to a valid memory address, hence your error. In fact, even if it did map to a valid address, the program would most likely crash anyway since that address would probably not contain a valid string; at the very least, you would get unexpected results.