fix a memleak in broadcom-diag (#1780)