diff options
Diffstat (limited to 'libports/bucket-iterate.c')
-rw-r--r-- | libports/bucket-iterate.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libports/bucket-iterate.c b/libports/bucket-iterate.c index babc2045..2d1b00d8 100644 --- a/libports/bucket-iterate.c +++ b/libports/bucket-iterate.c @@ -65,7 +65,7 @@ _ports_bucket_class_iterate (struct port_bucket *bucket, } pthread_mutex_unlock (&_ports_lock); - if (n != nr_items) + if (n != 0 && n != nr_items) { /* We allocated too much. Release unused memory. */ void **new = realloc (p, n * sizeof *p); |