Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

libpcp: unlock context before returning #50

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+5 −1
Split
View
@@ -2268,8 +2268,12 @@ pmGetArchiveLabel(pmLogLabel *lp)
{
__pmContext *ctxp;
ctxp = __pmHandleToPtr(pmWhichContext());
- if (ctxp == NULL || ctxp->c_type != PM_CONTEXT_ARCHIVE)
+ if (ctxp == NULL)
+ return PM_ERR_NOCONTEXT;
+ if (ctxp->c_type != PM_CONTEXT_ARCHIVE) {
+ PM_UNLOCK(ctxp->c_lock);
return PM_ERR_NOCONTEXT;
+ }
else {
__pmLogLabel *rlp;
/*