How to prevent memory leaks in pthread? I am running a server client program where server has to execute a pthread program and pss the result to client. The client keeps asking for the command again and again until it is stopped. The result provided by server is true only in the first iteration but it is providing incorrect results from second iteration.
I tried to use pthread_join and pthread_exit to prevent memory leaks but still its showing incorrect results.