mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
tsort: pacify -fsanitizer=leak
* src/tsort.c (detect_loop): Free removed successor.
This commit is contained in:
1 parent
a08853948c
commit
a7de740baa
1 file changed
+4
-2
+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