Michal Privoznik a7c016e4cb virpcivpdtest: Fix potential double-free()
Inside the testPCIVPDResourceCustomCompareIndex() function we
have two variables @a and @b, both marked as g_autoptr(). Then,
towards the end of the function b->value is freed and set to
a->value. This is to make sure
virPCIVPDResourceCustomCompareIndex() works correctly even if
->value member is the same for both arguments.

Nevertheless, if the function returns anything else than 0 then
the control executes subsequent return statement and since
b->value points to the very same string as a->value a double free
will occur. Avoid this by setting b->value to NULL explicitly,
just like we are already doing for the successful path.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2022-02-01 17:37:06 +01:00
..
2020-06-10 14:00:38 +02:00
2021-07-15 14:50:48 +02:00
2021-09-09 18:06:13 +02:00
2021-09-09 18:06:13 +02:00
2021-09-09 18:06:13 +02:00
2021-09-09 18:06:13 +02:00
2021-09-09 18:06:13 +02:00
2022-01-18 15:19:47 +01:00
2021-09-09 18:06:13 +02:00
2020-07-10 09:40:58 +02:00
2021-09-09 18:06:13 +02:00
2022-01-12 11:43:30 +01:00
2022-01-12 11:43:30 +01:00
2022-01-19 13:57:59 +01:00
2022-01-25 16:54:44 +01:00
2022-01-25 16:54:44 +01:00
2021-09-09 18:06:13 +02:00
2021-09-09 18:06:13 +02:00
2021-09-09 18:06:13 +02:00
2021-10-21 17:34:04 +01:00
2021-11-08 14:32:32 +01:00
2021-12-13 14:44:01 +01:00
2021-09-09 18:06:13 +02:00
2021-12-13 14:44:01 +01:00
2021-09-09 18:06:13 +02:00
2021-09-09 18:06:13 +02:00
2021-12-13 14:44:01 +01:00
2020-11-27 16:28:31 +01:00
2021-09-09 18:06:13 +02:00
2021-09-09 18:06:13 +02:00
2021-09-17 14:28:00 +02:00
2021-12-13 14:44:01 +01:00
2021-09-09 18:06:13 +02:00
2021-09-09 18:06:13 +02:00
2021-09-09 18:06:13 +02:00
2021-09-09 18:06:13 +02:00