Skip to content
Snippets Groups Projects
Commit 7beacb49 authored by rswindell's avatar rswindell
Browse files

Created smb_freehashes() for modules outside of smblib (e.g. other DLLs) to

free the results of smb_msghashes().
parent cb489516
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2008 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
......@@ -267,6 +267,13 @@ hash_t** SMBCALL smb_msghashes(smbmsg_t* msg, const uchar* body)
return(hashes);
}
void SMBCALL smb_freehashes(hash_t** hashes)
{
size_t n;
FREE_LIST(hashes,n);
}
/* Calculates and stores the hashes for a single message */
int SMBCALL smb_hashmsg(smb_t* smb, smbmsg_t* msg, const uchar* text, BOOL update)
{
......
......@@ -186,6 +186,7 @@ SMBEXPORT hash_t** SMBCALL smb_msghashes(smbmsg_t* msg, const uchar* text);
SMBEXPORT int SMBCALL smb_addhashes(smb_t* smb, hash_t** hash_list, BOOL skip_marked);
SMBEXPORT uint16_t SMBCALL smb_name_crc(const char* name);
SMBEXPORT uint16_t SMBCALL smb_subject_crc(const char *subj);
SMBEXPORT void SMBCALL smb_freehashes(hash_t**);
/* Fast look-up functions (using hashes) */
SMBEXPORT int SMBCALL smb_getmsgidx_by_hash(smb_t* smb, smbmsg_t* msg, unsigned source
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment