added additional memory free
parent
10f21a8c03
commit
5ad64e2c9a
|
@ -61,6 +61,10 @@ void AwaitDGram()
|
|||
socklen_t clilen; /* length of address' */
|
||||
|
||||
while (cleanup != 1) {
|
||||
if (cleanup == 1){
|
||||
CyaSSL_Cleanup();
|
||||
CyaSSL_CTX_free(ctx);
|
||||
}
|
||||
if ( (listenfd = socket(AF_INET, SOCK_DGRAM, 0) ) < 0 ) {
|
||||
printf("Cannot create socket.\n");
|
||||
cleanup = 1;
|
||||
|
@ -125,8 +129,6 @@ void AwaitDGram()
|
|||
printf("Recvfrom failed.\n");
|
||||
cleanup = 1;
|
||||
}
|
||||
pthread_t threadID = pthread_self();
|
||||
pthread_join(threadID, (void*)&connfd);
|
||||
|
||||
sleep(1);
|
||||
continue;
|
||||
|
@ -306,5 +308,6 @@ int main(int argc, char** argv)
|
|||
CyaSSL_Cleanup();
|
||||
CyaSSL_CTX_free(ctx);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue