mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-09 04:49:05 +00:00
FS-9775: Added salloc calls for other entities
The use of salloc in the main ks_dht_t for the inner nodeid suggests salloc calls should be renamed prealloc to avoid confusion where not used on stack variables
This commit is contained in:
1 parent
63d0d8dc4a
commit
b331b72ebe
5 files changed
+35
-1
No files matched your search
@@ -17,6 +17,19 @@ KS_DECLARE(ks_status_t) ks_dht2_nodeid_alloc(ks_dht2_nodeid_t **nodeid, ks_pool_
|
||||
return KS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
KS_DECLARE(ks_status_t) ks_dht2_nodeid_salloc(ks_dht2_nodeid_t *nodeid, ks_pool_t *pool)
|
||||
{
|
||||
ks_assert(nodeid);
|
||||
ks_assert(pool);
|
||||
|
||||
nodeid->pool = pool;
|
||||
|
||||
return KS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -36,6 +49,7 @@ KS_DECLARE(ks_status_t) ks_dht2_nodeid_free(ks_dht2_nodeid_t *nodeid)
|
||||
KS_DECLARE(ks_status_t) ks_dht2_nodeid_init(ks_dht2_nodeid_t *nodeid, const uint8_t *id)
|
||||
{
|
||||
ks_assert(nodeid);
|
||||
ks_assert(nodeid->pool);
|
||||
|
||||
if (!id) {
|
||||
randombytes_buf(nodeid->id, KS_DHT_NODEID_LENGTH);
|
||||
|
||||
Reference in new issue
Block a user