mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
Fix two memory leaks. tdb_search_keys allocates space for the key
strings. Running 'net cache list' or secrets_get_trusted_domains through valgrind gives a *huge* amount of invalid reads of one byte beyond the indicated string length in libc's strncpy. Annoying... Volker
This commit is contained in:
@ -329,6 +329,7 @@ void gencache_iterate(void (*fn)(const char* key, const char *value, time_t time
|
||||
if (!databuf.dptr || databuf.dsize <= TIMEOUT_LEN) {
|
||||
SAFE_FREE(databuf.dptr);
|
||||
SAFE_FREE(keystr);
|
||||
SAFE_FREE(node->node_key.dptr);
|
||||
node = node->next;
|
||||
continue;
|
||||
}
|
||||
@ -344,6 +345,7 @@ void gencache_iterate(void (*fn)(const char* key, const char *value, time_t time
|
||||
SAFE_FREE(valstr);
|
||||
SAFE_FREE(entry);
|
||||
SAFE_FREE(keystr);
|
||||
SAFE_FREE(node->node_key.dptr);
|
||||
node = node->next;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user