diff options
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/samlogon_cache.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/libsmb/samlogon_cache.c b/source3/libsmb/samlogon_cache.c index 3edbbaa2c1..0791cd80e4 100644 --- a/source3/libsmb/samlogon_cache.c +++ b/source3/libsmb/samlogon_cache.c @@ -192,10 +192,13 @@ NET_USER_INFO_3* netsamlogon_cache_get( TALLOC_CTX *mem_ctx, const DOM_SID *user data = tdb_fetch_bystring( netsamlogon_tdb, keystr ); if ( data.dptr ) { - - if ( (user = SMB_MALLOC_P(NET_USER_INFO_3)) == NULL ) + + + user = TALLOC_ZERO_P(mem_ctx, NET_USER_INFO_3); + if (user == NULL) { return NULL; - + } + prs_init( &ps, 0, mem_ctx, UNMARSHALL ); prs_give_memory( &ps, (char *)data.dptr, data.dsize, True ); @@ -247,7 +250,6 @@ BOOL netsamlogon_cache_have(const DOM_SID *user_sid) result = (user != NULL); talloc_destroy(mem_ctx); - SAFE_FREE(user); return result; } |