summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-03-13 23:48:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:26 -0500
commit846c4520ce102883825e3d2e1adba79a0b45a7d5 (patch)
tree49ec5c56f5a5bb3284c695a45f9ac332f9f9b526
parentd1684fa82ef8720341179238b65a768777681f34 (diff)
downloadsamba-846c4520ce102883825e3d2e1adba79a0b45a7d5.tar.gz
samba-846c4520ce102883825e3d2e1adba79a0b45a7d5.tar.bz2
samba-846c4520ce102883825e3d2e1adba79a0b45a7d5.zip
r14355: Try and fix Coverity #158 by making the pointer
aliasing clearer. This isn't a bug but a code clarification. Jeremy. (This used to be commit 7ada96a1cfb1e928b7dfde101ca250b20024243f)
-rw-r--r--source3/libsmb/smb_signing.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source3/libsmb/smb_signing.c b/source3/libsmb/smb_signing.c
index f0f2024e7b..52e4b1d04c 100644
--- a/source3/libsmb/smb_signing.c
+++ b/source3/libsmb/smb_signing.c
@@ -426,18 +426,20 @@ We were expecting seq %u\n", reply_seq_number, saved_seq ));
static void simple_free_signing_context(struct smb_sign_info *si)
{
struct smb_basic_signing_context *data = si->signing_context;
- struct outstanding_packet_lookup *list = data->outstanding_packet_list;
+ struct outstanding_packet_lookup *list;
+ struct outstanding_packet_lookup *next;
- while (list) {
- struct outstanding_packet_lookup *old_head = list;
- DLIST_REMOVE(list, list);
- SAFE_FREE(old_head);
+ for (list = data->outstanding_packet_list; list; list = next) {
+ next = list->next;
+ DLIST_REMOVE(data->outstanding_packet_list, list);
+ SAFE_FREE(list);
}
data_blob_free(&data->mac_key);
- if (data->trans_info)
+ if (data->trans_info) {
SAFE_FREE(data->trans_info);
+ }
SAFE_FREE(si->signing_context);