>From coverity scan vhostmd-1.1/libmetrics/libmetrics.c:595: missing_unlock: Returning without unlocking "libmetrics_mutex". 593| if (mdisk_alloc() == NULL) { 594| errno = ENOMEM; 595|-> return -1; 596| } 597| read_mdisk(mdisk); Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx> --- libmetrics/libmetrics.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libmetrics/libmetrics.c b/libmetrics/libmetrics.c index 2819f80..756645c 100644 --- a/libmetrics/libmetrics.c +++ b/libmetrics/libmetrics.c @@ -601,7 +601,7 @@ int get_metric(const char *metric_name, metric **mdef, metric_context context) mdisk_free(); if (mdisk_alloc() == NULL) { errno = ENOMEM; - return -1; + goto out; } read_mdisk(mdisk); } @@ -620,7 +620,7 @@ int get_metric(const char *metric_name, metric **mdef, metric_context context) if ((lmdef = metric_alloc_padded(extra_len)) == NULL) { errno = ENOMEM; - return -1; + goto out; } lmdef->type = pmdef.type; @@ -635,6 +635,7 @@ int get_metric(const char *metric_name, metric **mdef, metric_context context) if (pmdef.context) free(pmdef.context); +out: /* unlock library data */ pthread_mutex_unlock(&libmetrics_mutex); return ret; -- 2.16.4 _______________________________________________ virt-tools-list mailing list virt-tools-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/virt-tools-list