mirror of
git://git.sv.gnu.org/coreutils
synced 2026-05-11 01:19:38 -04:00
tsort: pacify -fsanitizer=leak
* src/tsort.c (detect_loop): Free removed successor.
This commit is contained in:
+4
-2
@@ -352,8 +352,10 @@ detect_loop (struct item *k)
|
||||
if (loop == k)
|
||||
{
|
||||
/* Remove relation. */
|
||||
(*p)->suc->count--;
|
||||
*p = (*p)->next;
|
||||
struct successor *s = *p;
|
||||
s->suc->count--;
|
||||
*p = s->next;
|
||||
IF_LINT (free (s));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user