diff options
author | Volker Lendecke <vl@samba.org> | 2012-03-29 14:16:04 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2012-03-29 15:50:13 +0200 |
commit | ed43a5a94f79b5d2ecbc7ab700b1fd3f96c48ac7 (patch) | |
tree | d3aa1f05f94eb1f7c4cf4855bc082dfdeef3b5dd /source3/lib | |
parent | 593e731097bc6f2fd50034f5e3ddac017894e584 (diff) | |
download | samba-ed43a5a94f79b5d2ecbc7ab700b1fd3f96c48ac7.tar.gz samba-ed43a5a94f79b5d2ecbc7ab700b1fd3f96c48ac7.tar.bz2 samba-ed43a5a94f79b5d2ecbc7ab700b1fd3f96c48ac7.zip |
s3: Fix a valgrind error
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Thu Mar 29 15:50:13 CEST 2012 on sn-devel-104
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/messages.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/lib/messages.c b/source3/lib/messages.c index 947a27443d..6a18e4f079 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -69,10 +69,17 @@ static void ping_message(struct messaging_context *msg_ctx, struct server_id src, DATA_BLOB *data) { - const char *msg = data->data ? (const char *)data->data : "none"; + const char *msg = "none"; + char *free_me = NULL; + if (data->data != NULL) { + free_me = talloc_strndup(talloc_tos(), (char *)data->data, + data->length); + msg = free_me; + } DEBUG(1,("INFO: Received PING message from PID %s [%s]\n", procid_str_static(&src), msg)); + TALLOC_FREE(free_me); messaging_send(msg_ctx, src, MSG_PONG, data); } |