[sheepdog] [PATCH v2] fix memory leak and wrong lock release in create_work_queue() function
justlinux2010
justlinux2010 at gmail.com
Sat Jun 15 16:13:33 CEST 2013
diff --git a/sheepdog/lib/work.c b/sheepdog_develop/lib/work.c
index b09c0db..abfee61 100644
--- a/sheepdog/lib/work.c
+++ b/sheepdog_develop/lib/work.c
@@ -318,11 +318,11 @@ struct work_queue *create_work_queue(const char *name,
return &wi->q;
destroy_threads:
- pthread_mutex_unlock(&wi->startup_lock);
pthread_cond_destroy(&wi->pending_cond);
pthread_mutex_destroy(&wi->pending_lock);
pthread_mutex_destroy(&wi->startup_lock);
pthread_mutex_destroy(&wi->finished_lock);
+ free(wi);
return NULL;
}
2013-06-15
justlinux2010
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/sheepdog/attachments/20130615/27e3472a/attachment-0003.html>
More information about the sheepdog
mailing list