You're right; I thought I checked for prior uses but I guess I missed them. Those uses of argv[0] are conditional and shouldn't actually cause null dereferences if argv[0] is NULL, but given that they are there, the check should be moved upwards.