[Samba4] Memory leaks in authentication code

Karl Melcher kmelcher at gmail.com
Fri Sep 23 20:36:20 GMT 2005


I have identified a few more minor memory leaks in the authentication code.
Mostly blocks of data talloc'ed with a NULL source pointer. Most of these
don't seem to have handy memory contexts to hang the new pointers onto. The
combined affect is about 140 bytes when authenticating a client connection
against a Win 2003 server.

(1)
source/libcli/util/asn1.c:
BOOL asn1_read_OID(...)
tmp_oid = talloc_asprintf(NULL, "%u", b/40);


(2)
// This one is self contained and can be fixed with simple talloc context
init/free
source/libcli/util/asn1.c:
BOOL asn1_read_LDAPString(struct asn1_data *data, char **s)
*s = talloc_size(NULL, len+1);


(3)
source/auth/gensec/spnego_parse.c
BOOL read_negTokenInit( ... )
token->mechTypes = talloc(NULL, const char *);
...
token->mechTypes = talloc_realloc(NULL, ...



Karl


More information about the samba-technical mailing list