Fixed: spinlock_release is before free

Fixed: spinlock_release is before free
This commit is contained in:
MassimilianoPinto 2015-09-18 16:05:22 +02:00
parent 67c9f30632
commit 8d5ca11374

View File

@ -596,9 +596,14 @@ blr_close_binlog(ROUTER_INSTANCE *router, BLFILE *file)
close(file->fd);
file->fd = -1;
}
spinlock_release(&file->lock);
if (file->refcnt == 0)
if (file->refcnt == 0) {
spinlock_release(&file->lock);
free(file);
} else {
spinlock_release(&file->lock);
}
}
/**