redmine

Few valgrind-fixes

... ... @@ -367,7 +367,6 @@ int control_run(ctx_t *ctx_p) {
ret = errno;
} else {
s = clsyncsock->sock;
clsyncsock->sock = -1;
socket_cleanup(clsyncsock);
}
}
... ...
... ... @@ -91,7 +91,7 @@ static inline clsyncproc_t *_clsync_x_unix(
socket_sockthreaddata_t *threaddata_p = socket_thread_attach(proc_p->sock_p);
if (threaddata_p == NULL) {
socket_cleanup(proc_p->sock_p);
socket_close(proc_p->sock_p);
free(proc_p);
return NULL;
}
... ...
... ... @@ -314,7 +314,7 @@ int parse_parameter(ctx_t *ctx_p, uint16_t param_id, char *arg, paramsource_t pa
if (ctx_p->flags_values_raw[param_id] != NULL)
free(ctx_p->flags_values_raw[param_id]);
ctx_p->flags_values_raw[param_id] = strdup(arg);
ctx_p->flags_values_raw[param_id] = arg;
}
switch(param_id) {
... ...
... ... @@ -131,12 +131,17 @@ int socket_cleanup(clsyncsock_t *clsyncsock_p) {
recv_ptrs[clsyncsock_sock] = NULL;
recv_stps[clsyncsock_sock] = NULL;
close(clsyncsock_sock);
free(clsyncsock_p);
return 0;
}
int socket_close(clsyncsock_t *clsyncsock_p) {
close(clsyncsock_p->sock);
return socket_cleanup(clsyncsock_p);
}
int socket_thread_delete(socket_sockthreaddata_t *threaddata_p) {
int thread_id;
... ... @@ -144,7 +149,7 @@ int socket_thread_delete(socket_sockthreaddata_t *threaddata_p) {
thread_id = threaddata_p->id;
socket_cleanup(threaddata_p->clsyncsock_p);
socket_close(threaddata_p->clsyncsock_p);
clsyncsockthreads_count--;
... ...
... ... @@ -194,6 +194,7 @@ extern int socket_recv(clsyncsock_t *clsyncsock, sockcmd_t *sockcmd);
extern int socket_check_bysock(int sock);
extern clsyncsock_t *socket_accept(int sock);
extern int socket_cleanup(clsyncsock_t *clsyncsock_p);
extern int socket_close(clsyncsock_t *clsyncsock_p);
extern int socket_init();
extern int socket_deinit();
extern int socket_procclsyncsock(socket_sockthreaddata_t *arg);
... ...