LP#1468422 free barcode regex
authorBill Erickson <berickxx@gmail.com>
Mon, 23 Nov 2015 16:25:12 +0000 (11:25 -0500)
committerBill Erickson <berickxx@gmail.com>
Mon, 23 Nov 2015 16:25:34 +0000 (11:25 -0500)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/c-apps/oils_auth.c

index 63c200a..b9998b5 100644 (file)
@@ -349,6 +349,7 @@ static int oilsAuthIdentIsBarcode(const char* identifier) {
     if (compiled == NULL) {
         osrfLogError(OSRF_LOG_MARK,
             "Could not compile '%s': %s", bc_regex, err_str);
+        free(bc_regex);
         pcre_free(compiled);
         return 0;
     }
@@ -358,6 +359,7 @@ static int oilsAuthIdentIsBarcode(const char* identifier) {
     if(err_str != NULL) {
         osrfLogError(OSRF_LOG_MARK,
             "Could not study regex '%s': %s", bc_regex, err_str);
+        free(bc_regex);
         pcre_free(compiled);
         return 0;
     } 
@@ -365,6 +367,7 @@ static int oilsAuthIdentIsBarcode(const char* identifier) {
     match_ret = pcre_exec(
         compiled, extra, identifier, strlen(identifier), 0, 0, NULL, 0);       
 
+    free(bc_regex);
     pcre_free(compiled);
     if (extra) pcre_free(extra);