pls read man fork to get more info, here is a c&p:
On failure, a -1 will be returned in the parent's context, no child process will be created, and errno will be set appropriately.
ERRORS
EAGAIN fork cannot allocate sufficient memory to copy the parent's page tables and allocate a task structure for the child.
ENOMEM fork failed to allocate the necessary kernel structures because memory is tight.
u can send a signal to any process to kill it. but the question does not mention this.