2729: Fix potential error in set_var()