]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Prevent deadlock on malloc() failure. 1408/head
authorBartosz Szreder <bartosz.szreder@huuugegames.com>
Thu, 8 Nov 2018 09:29:31 +0000 (10:29 +0100)
committerBartosz Szreder <bartosz.szreder@huuugegames.com>
Thu, 8 Nov 2018 09:29:31 +0000 (10:29 +0100)
lib/dictBuilder/cover.c

index 6b4af69d29c5979af32279488d5b7e3bca13ecac..1960395b6eef7a63aba3d56a449f8f9e651bd008 100644 (file)
@@ -868,6 +868,8 @@ void COVER_best_finish(COVER_best_t *best, size_t compressedSize,
         if (!best->dict) {
           best->compressedSize = ERROR(GENERIC);
           best->dictSize = 0;
+          ZSTD_pthread_cond_signal(&best->cond);
+          ZSTD_pthread_mutex_unlock(&best->mutex);
           return;
         }
       }