cook: fix use of uninitialized variable