mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-02 01:17:52 +03:00
Improve request_queue_(new,free).
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@581 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
@@ -481,21 +481,26 @@ int sftp_init(SFTP_SESSION *sftp) {
|
||||
}
|
||||
|
||||
static REQUEST_QUEUE *request_queue_new(SFTP_MESSAGE *msg) {
|
||||
REQUEST_QUEUE *queue;
|
||||
REQUEST_QUEUE *queue = NULL;
|
||||
|
||||
queue = malloc(sizeof(REQUEST_QUEUE));
|
||||
if (queue == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
ZERO_STRUCTP(queue);
|
||||
|
||||
memset(queue,0,sizeof(REQUEST_QUEUE));
|
||||
queue->message = msg;
|
||||
|
||||
return queue;
|
||||
}
|
||||
|
||||
static void request_queue_free(REQUEST_QUEUE *queue) {
|
||||
memset(queue,0,sizeof(*queue));
|
||||
free(queue);
|
||||
if (queue == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
ZERO_STRUCTP(queue);
|
||||
SAFE_FREE(queue);
|
||||
}
|
||||
|
||||
void sftp_enqueue(SFTP_SESSION *sftp, SFTP_MESSAGE *msg){
|
||||
|
||||
Reference in New Issue
Block a user