1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
samba-mirror/examples/libsmbclient/testctx.c
Jeremy Allison 03991ab073 Fix bug 5686 - libsmbclient segfaults with more than one SMBCCTX.
Here is a patch to allow many subsystems to be re-initialized. The only
functional change I made was to remove the null context tracking, as the memory
allocated here is designed to be left for the complete lifetime of the program.
Freeing this early (when all smb contexts are destroyed) could crash other
users of talloc.
Jeremy.
(This used to be commit 8c630efd25)
2008-08-12 13:35:15 -07:00

18 lines
289 B
C

#include <libsmbclient.h>
void create_and_destroy_context (void)
{
SMBCCTX *ctx;
ctx = smbc_new_context ();
smbc_init_context (ctx);
smbc_free_context (ctx, 1);
}
int main (int argc, char **argv)
{
create_and_destroy_context ();
create_and_destroy_context ();
return 0;
}