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