Made suggested changes, rephrased the description. But I never learned C and am not at ease for adding checks in C source code, sorry.
I have made a PR at <https://github.com/ajraymond/restartd/pull/8> adding some error checking.
Greetings,
Maxime.