vendor/libgit2/src/signature.c in rugged-0.26.0b5 vs vendor/libgit2/src/signature.c in rugged-0.26.0
- old
+ new
@@ -226,11 +226,14 @@
/* Do we even have a time at the end of the signature? */
if (email_end + 2 < buffer_end) {
const char *time_start = email_end + 2;
const char *time_end;
- if (git__strtol64(&sig->when.time, time_start, &time_end, 10) < 0)
+ if (git__strtol64(&sig->when.time, time_start, &time_end, 10) < 0) {
+ git__free(sig->name);
+ git__free(sig->email);
return signature_error("invalid Unix timestamp");
+ }
/* do we have a timezone? */
if (time_end + 1 < buffer_end) {
int offset, hours, mins;
const char *tz_start, *tz_end;