diff options
author | Volker Lendecke <vlendec@samba.org> | 2003-07-01 12:40:52 +0000 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2003-07-01 12:40:52 +0000 |
commit | 0f8933ae778064ff58cdc832ce52c843631435bb (patch) | |
tree | 6038912dd56f01089b4bab41d6bbdc8bdb573eb7 /source/lib/gencache.c | |
parent | f036368efdcbe576552ea85a78e5e6199a2b2c6d (diff) | |
download | samba-0f8933ae778064ff58cdc832ce52c843631435bb.tar.gz samba-0f8933ae778064ff58cdc832ce52c843631435bb.tar.xz samba-0f8933ae778064ff58cdc832ce52c843631435bb.zip |
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
Diffstat (limited to 'source/lib/gencache.c')
-rw-r--r-- | source/lib/gencache.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/lib/gencache.c b/source/lib/gencache.c index f3740e3e127..b94e35eff4d 100644 --- a/source/lib/gencache.c +++ b/source/lib/gencache.c @@ -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; } |