diff --git a/CHANGES b/CHANGES index be9a3d8ee8..ff53b6f259 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +6.2.0-dev.137 | 2023-11-11 17:45:51 +0100 + + * Bind scan_path to the scope; avoid heap allocation (Dominik Charousset, Corelight) + 6.2.0-dev.134 | 2023-11-10 12:42:57 +0100 * retention of superseded AST elements to prevent pointer mis-aliasing (Vern Paxson, Corelight) diff --git a/VERSION b/VERSION index 8d83aa389c..bae830d77f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.2.0-dev.134 +6.2.0-dev.137 diff --git a/src/zeekygen/Target.cc b/src/zeekygen/Target.cc index 519f4ccd24..a7e9b5bad7 100644 --- a/src/zeekygen/Target.cc +++ b/src/zeekygen/Target.cc @@ -439,15 +439,12 @@ vector dir_contents_recursive(string dir) { while ( dir[dir.size() - 1] == '/' ) dir.erase(dir.size() - 1, 1); - char** scan_path = new char*[2]; - scan_path[0] = dir.data(); - scan_path[1] = NULL; + char* scan_path[2] = {dir.data(), nullptr}; FTS* fts = fts_open(scan_path, FTS_NOCHDIR, 0); if ( ! fts ) { reporter->Error("fts_open failure: %s", strerror(errno)); - delete[] scan_path; return rval; } @@ -464,7 +461,6 @@ vector dir_contents_recursive(string dir) { if ( fts_close(fts) < 0 ) reporter->Error("fts_close failure: %s", strerror(errno)); - delete[] scan_path; return rval; }