describe example: function to add commits to opts Add safe function to (a,rea)llocate memory which terminate example on memory allocation failure. Move code to allocate commits to its own function.