]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix database locking calling db_lock and returning from function without calling...
authorMarco van Wieringen <mvw@planets.elm.net>
Sat, 27 Mar 2010 22:02:17 +0000 (23:02 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 2 Aug 2010 14:49:42 +0000 (16:49 +0200)
bacula/src/cats/sql_list.c

index 6c005ca517b37f2d3202ec8ae7d364e2cb0a8d83..aa903a0ca0090621ff388a4569c4f97b90dba20e 100644 (file)
@@ -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));