Skip to content
  • Brandon Casey's avatar
    cleanup: use internal memory allocation wrapper functions everywhere · 040a6551
    Brandon Casey authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    The "x"-prefixed versions of strdup, malloc, etc. will check whether the
    allocation was successful and terminate the process otherwise.
    
    A few uses of malloc were left alone since they already implemented a
    graceful path of failure or were in a quasi external library like xdiff.
    
    Additionally, the call to malloc in compat/win32/syslog.c was not modified
    since the syslog() implemented there is a die handler and a call to the
    x-wrappers within a die handler could result in recursion should memory
    allocation fail.  This will have to be addressed separately.
    
    Signed-off-by: default avatarBrandon Casey <drafnel@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    040a6551