From 40ab07673d7dbafac57deda37c5f1483d8cfcf87 Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Sat, 27 Mar 2010 23:02:17 +0100 Subject: [PATCH] Fix database locking calling db_lock and returning from function without calling db_unlock. --- bacula/src/cats/sql_list.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bacula/src/cats/sql_list.c b/bacula/src/cats/sql_list.c index 6c005ca517..aa903a0ca0 100644 --- a/bacula/src/cats/sql_list.c +++ b/bacula/src/cats/sql_list.c @@ -291,10 +291,11 @@ void db_list_joblog_records(JCR *jcr, B_DB *mdb, uint32_t JobId, DB_LIST_HANDLER *sendit, void *ctx, e_list_type type) { char ed1[50]; - db_lock(mdb); + if (JobId <= 0) { return; } + db_lock(mdb); if (type == VERT_LIST) { Mmsg(mdb->cmd, "SELECT Time,LogText FROM Log " "WHERE Log.JobId=%s", edit_int64(JobId, ed1)); -- 2.39.5