Browse code

bcomp - fix memory leak caused by allocation of heap space for subsigid when setting up byte compare scan criteria in cli_bcomp_scanbuf

Mickey Sola authored on 2019/12/05 03:11:27
Showing 1 changed files
... ...
@@ -540,6 +540,11 @@ cl_error_t cli_bcomp_scanbuf(const unsigned char *buffer, size_t buffer_length,
540 540
         }
541 541
     }
542 542
 
543
+    if (subsigid) {
544
+        free(subsigid);
545
+        subsigid = NULL;
546
+    }
547
+
543 548
     if (ret == CL_SUCCESS && viruses_found) {
544 549
         return CL_VIRUS;
545 550
     }