Check retval and tainted data: prevent from crashing if row_data is NULL or not found

We end up with an array of fmids which may exceeds our needs - may need a small update with talloc_realloc upon successful assignation