From: Marco van Wieringen Date: Sat, 27 Mar 2010 22:02:17 +0000 (+0100) Subject: Fix database locking calling db_lock and returning from function without calling... X-Git-Tag: Release-5.2.1~1564 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6aec1a841220a27bf384a0267f6f1fa614f58816;p=bacula%2Fbacula Fix database locking calling db_lock and returning from function without calling db_unlock. --- 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));