fix bug 2957, 'Double-free in account preferences'