author | Brandon Casey <drafnel@gmail.com> | |
Thu, 6 Oct 2011 18:22:22 +0000 (13:22 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 6 Oct 2011 20:54:32 +0000 (13:54 -0700) | ||
commit | 040a655116c9755bbf30acd22c34eecb2f502c6d | |
tree | 6e1260d25fa2de20f150159de83cae2251c70824 | tree | snapshot |
parent | 97410b27e91593c4096bb16abbace783895a1f62 | commit | diff |
cleanup: use internal memory allocation wrapper functions everywhere
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: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
attr.c | diff | blob | history | |
builtin/mv.c | diff | blob | history | |
compat/mingw.c | diff | blob | history | |
compat/qsort.c | diff | blob | history | |
remote.c | diff | blob | history | |
show-index.c | diff | blob | history | |
transport-helper.c | diff | blob | history |