RTPS: Don't leak in the guid hash
If hashing a newly created GBytes, unref the GBytes after computing the hash (and before returning it.) Fix #19558 (in combination with45b929a1b6
and6f17dcd67d
)
This commit is contained in:
parent
dd7df70be8
commit
ca02798714
|
@ -6496,7 +6496,9 @@ static guint hash_by_participant_guid(gconstpointer key) {
|
|||
const endpoint_guid* guid = (const endpoint_guid*)key;
|
||||
gint vals[] = { guid->host_id, guid->app_id, guid->instance_id };
|
||||
GBytes* gbytes = g_bytes_new(vals, sizeof(vals));
|
||||
return g_bytes_hash(gbytes);
|
||||
guint hash = g_bytes_hash(gbytes);
|
||||
g_bytes_unref(gbytes);
|
||||
return hash;
|
||||
}
|
||||
|
||||
static guint hash_by_guid(gconstpointer key) {
|
||||
|
|
Loading…
Reference in New Issue