Avoid undefined behaviour and memory leaks in case-data-generator

This was found using the clang-sanitizers and was pretty tough to spot.

The first part does not influence program-operation as is, but checking
first if tmp2 is NULL avoids undefined behaviour of adding a non-zero
offset to NULL.

Signed-off-by: Laslo Hunhold <dev@frign.de>
1 file changed