chiark / gitweb /
Fix trackdb_search() deadlock handling.
authorRichard Kettlewell <richard@deodand>
Thu, 17 Jun 2010 20:11:58 +0000 (21:11 +0100)
committerRichard Kettlewell <richard@deodand>
Thu, 17 Jun 2010 20:11:58 +0000 (21:11 +0100)
lib/trackdb.c

index 628498a..24d04ac 100644 (file)
@@ -2493,6 +2493,9 @@ char **trackdb_search(char **wordlist, int nwordlist, int *ntracks) {
     }
     if(trackdb_closecursor(cursor)) err = DB_LOCK_DEADLOCK;
     cursor = 0;
+    if(err)
+      goto fail;
+    cursor = 0;
     /* do a naive search over that (hopefuly fairly small) list of tracks */
     u.nvec = 0;
     for(n = 0; n < v.nvec; ++n) {