what if l or r are NULL? this segfaults then