Commit 34c13106 by Edward Thomson

signature: free dup'd buffers on parse error

parent 4dbcf0e6
...@@ -228,8 +228,11 @@ int git_signature__parse(git_signature *sig, const char **buffer_out, ...@@ -228,8 +228,11 @@ int git_signature__parse(git_signature *sig, const char **buffer_out,
const char *time_start = email_end + 2; const char *time_start = email_end + 2;
const char *time_end; 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"); return signature_error("invalid Unix timestamp");
}
/* do we have a timezone? */ /* do we have a timezone? */
if (time_end + 1 < buffer_end) { if (time_end + 1 < buffer_end) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment