]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Catch by reference not value
authorMatthew Barr <matthew.barr@intel.com>
Mon, 19 Jun 2017 02:53:34 +0000 (12:53 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Mon, 21 Aug 2017 01:20:20 +0000 (11:20 +1000)
src/hs.cpp

index e3c1f811c996bbb471dd2707bd56a843905e7856..9305c9249d17ce7a4ec6d0d69e383596cbd404e2 100644 (file)
@@ -262,7 +262,7 @@ hs_compile_multi_int(const char *const *expressions, const unsigned *flags,
                                            e.hasIndex ? (int)e.index : -1);
         return HS_COMPILER_ERROR;
     }
-    catch (std::bad_alloc) {
+    catch (const std::bad_alloc &) {
         *db = nullptr;
         *comp_error = const_cast<hs_compile_error_t *>(&hs_enomem);
         return HS_COMPILER_ERROR;
@@ -399,7 +399,7 @@ hs_error_t hs_expression_info_int(const char *expression, unsigned int flags,
         *error = generateCompileError(e);
         return HS_COMPILER_ERROR;
     }
-    catch (std::bad_alloc) {
+    catch (std::bad_alloc &) {
         *error = const_cast<hs_compile_error_t *>(&hs_enomem);
         return HS_COMPILER_ERROR;
     }