summaryrefslogtreecommitdiff
path: root/source3/lib/netapi/examples
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-01-08 11:55:45 +0100
committerGünther Deschner <gd@samba.org>2008-01-08 11:59:01 +0100
commit67f2afe3c4cfd46aa20b7a7c568ac6b5ab16acb8 (patch)
treed0c560715fb9ec4db4d33736472c3a7f5c346478 /source3/lib/netapi/examples
parent200bba3ad6592952041daa9da9805941c6dd03ba (diff)
downloadsamba-67f2afe3c4cfd46aa20b7a7c568ac6b5ab16acb8.tar.gz
samba-67f2afe3c4cfd46aa20b7a7c568ac6b5ab16acb8.tar.bz2
samba-67f2afe3c4cfd46aa20b7a7c568ac6b5ab16acb8.zip
Correctly free buffers in netdomjoin-gui.
Guenther (This used to be commit 04d78d4d9a8cffe44c927036038aef1d6d6b44b2)
Diffstat (limited to 'source3/lib/netapi/examples')
-rw-r--r--source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c b/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c
index 1e1681ba37..4a3588e9ab 100644
--- a/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c
+++ b/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c
@@ -249,6 +249,8 @@ static void callback_do_reboot(GtkWidget *widget,
SAFE_FREE(buffer);
state->name_type_new = type;
#endif
+ NetApiBufferFree((void *)buffer);
+
gtk_label_set_text(GTK_LABEL(state->label_current_name_buffer),
state->name_buffer_new);
if (state->name_type_new == NetSetupDomainName) {
@@ -1292,8 +1294,12 @@ static int initialize_join_state(struct join_state *state,
if (status) {
return status;
}
- state->name_buffer_initial = (char *)buffer;
+ state->name_buffer_initial = strdup(buffer);
+ if (!state->name_buffer_initial) {
+ return -1;
+ }
state->name_type_initial = type;
+ NetApiBufferFree((void *)buffer);
}
{
@@ -1311,6 +1317,7 @@ static int initialize_join_state(struct join_state *state,
if (!state->comment) {
return -1;
}
+ NetApiBufferFree(buffer);
}
#if 0
{