1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Support address sanitizer for utest and fix some leaks. (#3242)

* MP4: Fix memory leak when error.

* Kernel: Support free global objects for utest.

* HTTP: Fix memory leak when error.

* MP4: Support more sample rate for audio.

* RTMP: Support free field for utest.

* UTest: Support address sanitizer.
This commit is contained in:
Winlin 2022-11-18 11:19:01 +08:00 committed by GitHub
parent be0241efdb
commit 368356c223
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 360 additions and 154 deletions

View file

@ -689,12 +689,14 @@ srs_error_t SrsHttpServeMux::handle(std::string pattern, ISrsHttpHandler* handle
srs_assert(handler);
if (pattern.empty()) {
srs_freep(handler);
return srs_error_new(ERROR_HTTP_PATTERN_EMPTY, "empty pattern");
}
if (entries.find(pattern) != entries.end()) {
SrsHttpMuxEntry* exists = entries[pattern];
if (exists->explicit_match) {
srs_freep(handler);
return srs_error_new(ERROR_HTTP_PATTERN_DUPLICATED, "pattern=%s exists", pattern.c_str());
}
}