]> git.saurik.com Git - redis.git/commitdiff
fixed a problem in bioOlderJobType() when there are no jobs of the specified type...
authorantirez <antirez@gmail.com>
Thu, 15 Sep 2011 16:23:58 +0000 (18:23 +0200)
committerantirez <antirez@gmail.com>
Thu, 15 Sep 2011 16:23:58 +0000 (18:23 +0200)
src/bio.c

index 6f2c8a6c0d49d96e7a60722a31fd6428d27d085d..fc4d56695924fb17381dbcf8eaadd641cdb686c4 100644 (file)
--- a/src/bio.c
+++ b/src/bio.c
@@ -188,6 +188,10 @@ time_t bioOlderJobOfType(int type) {
 
     pthread_mutex_lock(&bio_mutex[type]);
     ln = listFirst(bio_jobs[type]);
+    if (ln == NULL) {
+        pthread_mutex_unlock(&bio_mutex[type]);
+        return 0;
+    }
     job = ln->value;
     time = job->time;
     pthread_mutex_unlock(&bio_mutex[type]);