Skip to content

Commit 678f2b7

Browse files
nielsbbvanassche
authored andcommitted
Protect malloc_trim() call with configure #ifdef
This fixes 460a97c "Give memory back to system post snmp operation" for BSD and others without the malloc_trim() function.
1 parent c92a0eb commit 678f2b7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

snmplib/container.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,9 @@ void CONTAINER_CLEAR(netsnmp_container *x, netsnmp_container_obj_func *f,
510510
x = x->prev;
511511
}
512512
x->clear(x, f, c);
513+
#ifdef HAVE_MALLOC_TRIM
513514
malloc_trim(0);
515+
#endif
514516
}
515517

516518
#ifndef NETSNMP_FEATURE_REMOVE_CONTAINER_FREE_ALL

0 commit comments

Comments
 (0)