mirror of
https://github.com/samba-team/samba.git
synced 2025-01-13 13:18:06 +03:00
03991ab073
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 8c630efd25cf17aff59448ca05c1b44a41964b16)
18 lines
289 B
C
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;
|
|
}
|