Correct fusd_destroy to lock and check before freeing.
This commit is contained in:
parent
fd1f2a7374
commit
9f496af46b
@ -650,13 +650,26 @@ void fusd_dispatch(int fd)
|
||||
*/
|
||||
void fusd_destroy(struct fusd_file_info *file)
|
||||
{
|
||||
if (file == NULL)
|
||||
return;
|
||||
if (file == NULL)
|
||||
return;
|
||||
|
||||
if (file->fusd_msg->data != NULL)
|
||||
free(file->fusd_msg->data);
|
||||
free(file->fusd_msg);
|
||||
free(file);
|
||||
FILE_LOCK(file);
|
||||
|
||||
if (file->fusd_msg != NULL)
|
||||
{
|
||||
if (file->fusd_msg->data != NULL)
|
||||
{
|
||||
free(file->fusd_msg->data);
|
||||
file->fusd_msg->data = NULL;
|
||||
}
|
||||
free(file->fusd_msg);
|
||||
file->fusd_msg = NULL;
|
||||
}
|
||||
FILE_UNLOCK(file);
|
||||
|
||||
pthread_mutex_destroy(&file->lock);
|
||||
|
||||
free(file);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user