commit a93813face580b1da5c73546b864c4ea6c7d3064 from: Martin Pieuchot date: Mon Jan 20 16:02:51 2020 UTC Remove double lock in error path. commit - 6b8a2b8fcd99c4365b1aa9513c0f0149beac2491 commit + a93813face580b1da5c73546b864c4ea6c7d3064 blob - 0e878ef6ce29b0000c95413125693c2703caeeee blob + 29fe34549ad3e8f46a02235eadb41701c94e22f1 --- tog/tog.c +++ tog/tog.c @@ -1424,10 +1424,6 @@ queue_commits(struct got_commit_graph *graph, struct c if (*searching == TOG_SEARCH_FORWARD && !*search_next_done) { err = match_commit(&have_match, id, commit, regex); - if (err) { - pthread_mutex_lock(&tog_mutex); - break; - } } errcode = pthread_mutex_unlock(&tog_mutex); @@ -1435,7 +1431,7 @@ queue_commits(struct got_commit_graph *graph, struct c err = got_error_set_errno(errcode, "pthread_mutex_unlock"); - if (have_match) + if (err || have_match) break; }