Univention Bugzilla – Bug 30263
Memory leaks, memory corruption, performance problems
Last modified: 2019-01-12 16:43:04 CET
While helping with Bug #30165 and working on Bug #30227 several memory leaks, memory corruption issues, performance issues and suspect code have been identified. A patch series consisting of 24 patches is available from git --git-dir ~phahn/GIT/.git log --p ucs-3.1/master..ucs-3.1/listener 8d8bd7c Bug #30227: listener: fix binary data corruption 4bdd2f1 Bug #30227: listener: assert null termination 3f8e25f Bug #30227: listener: allocation checking 7904df6 Bug #30227: listener: simplify pointer logic 3d7de08 Bug #30227: listener: convert if() to switch() bf75fd3 Bug #30227: listener: white space cleanup bd60106 Bug #30227: listener: handle allocation failures a1794f2 Bug #30227: listener: change function signature 9f3a375 Bug #30227: listener: magic types 343a4d1 Bug #30227: listener: skip strdup(dn) 42cfb86 Bug #30227: listener: rewrite copy_cache 307c0ec Bug #30227: listener: Rename cursors bbe637c Bug #30227: listener: declare functions extern 52c1d23 Bug #30227: listener: white space cleanup 51f742c Bug #30227: listener: fix ucr memory leak 681346f Bug #30227: listener: Handle allocation failure e371999 Bug #30227: listener: list entry 378b0cd Bug #30227: listener: simplify repeated dereference 73c2afe Bug #30227: listener: simplify next value loop 8d35838 Bug #30227: listener: simplify indirect pointers edd7294 Bug #30227: listener: Fix NULL check a65e153 Bug #30227: listener: error by default a47cd98 Bug #30227: listener: dn memory leak b106791 Bug #30227: listener: use local dn variable
Created attachment 5044 [details] Concatenated patch series
diff --git a/branches/ucs-3.2/ucs-3.2-1/management/univention-directory-listener/src/cache.c b/branches/ucs-3.2/ucs-3.2-1/management/univention-directory-listener/src/cache.c index a07bc54..cd70838 100644 --- a/branches/ucs-3.2/ucs-3.2-1/management/univention-directory-listener/src/cache.c +++ b/branches/ucs-3.2/ucs-3.2-1/management/univention-directory-listener/src/cache.c @@ -631,7 +631,7 @@ int cache_next_entry(DBC **cur, char **dn, CacheEntry *entry) return cache_next_entry(cur, dn, entry); } - if (!*dn) + if (*dn) free(*dn); *dn = strdup(key.data); diff --git a/branches/ucs-3.2/ucs-3.2-1/management/univention-directory-listener/src/change.c b/branches/ucs-3.2/ucs-3.2-1/management/univention-directory-listener/src/change.c index 3666f8a..6dfc32a 100644 --- a/branches/ucs-3.2/ucs-3.2-1/management/univention-directory-listener/src/change.c +++ b/branches/ucs-3.2/ucs-3.2-1/management/univention-directory-listener/src/change.c @@ -99,7 +99,7 @@ int change_init_module(univention_ldap_parameters_t *lp, Handler *handler) cache_update_or_deleteifunused_entry(0, dn, &cache_entry); cache_free_entry(&dn, &cache_entry); } - if(!dn) + if(dn) free(dn); univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_INFO,
r69906 | Bug #41261 UDL: Fix free(NULL) r69899 | Bug #30263 UDL: Allocate filenames on stack Package: univention-directory-listener Version: 10.0.0-11.315.201606071717 Branch: ucs_4.1-0 Scope: errata4.1-2 r69910 | Bug #22383,Bug #30227,Bug #30263,Bug #34324,Bug #34507,Bug #34738,Bug #3490,Bug #38696,Bug #39509,Bug #40600,Bug #41261: UDL YAML univention-directory-listener.yaml
This issue has been filled against UCS 4.1. The maintenance with bug and security fixes for UCS 4.1 has ended on 5st of April 2018. Customers still on UCS 4.1 are encouraged to update to UCS 4.3. Please contact your partner or Univention for any questions. If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.
4.3-3 <https://git.knut.univention.de/univention/ucs/commits/phahn/30263-udl-memory>