diff options
| author | Edward Thomson <ethomson@microsoft.com> | 2015-02-11 09:39:38 -0500 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2015-02-12 22:54:47 -0500 |
| commit | 2884cc42de8b20a58cec8488d014a853d47c047e (patch) | |
| tree | 19dbb80072107fe65c7dd1de5dd849cc6914b154 /src/win32/dir.c | |
| parent | 4aa664ae3953d99c2ae4cd769f02818bc122eebc (diff) | |
| download | libgit2-2884cc42de8b20a58cec8488d014a853d47c047e.tar.gz | |
overflow checking: don't make callers set oom
Have the ALLOC_OVERFLOW testing macros also simply set_oom in the
case where a computation would overflow, so that callers don't
need to.
Diffstat (limited to 'src/win32/dir.c')
| -rw-r--r-- | src/win32/dir.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/win32/dir.c b/src/win32/dir.c index 9953289f6..7f2a5a56e 100644 --- a/src/win32/dir.c +++ b/src/win32/dir.c @@ -20,10 +20,8 @@ git__DIR *git__opendir(const char *dir) if (GIT_ALLOC_OVERFLOW_ADD(sizeof(*new), dirlen) || GIT_ALLOC_OVERFLOW_ADD(sizeof(*new) + dirlen, 1) || - !(new = git__calloc(1, sizeof(*new) + dirlen + 1))) { - giterr_set_oom(); + !(new = git__calloc(1, sizeof(*new) + dirlen + 1))) return NULL; - } memcpy(new->dir, dir, dirlen); |
