commit 346b301a6191bd87507ba2768ce7a2adae448a06 from: Stefan Sperling date: Sun Oct 06 18:51:41 2019 UTC check for errors from buf_append() in diff3.c's diff_output() commit - 950435fdd34fce306f6083edd389d03f7c8417ba commit + 346b301a6191bd87507ba2768ce7a2adae448a06 blob - db5338772d9189502c14c2cd7dd82e650b39ce3a blob + 4d9643e9bac62f141ee3a5b6d40826d1606f463e --- lib/diff3.c +++ lib/diff3.c @@ -173,6 +173,7 @@ static const struct got_error *diff3_internal(char *, static const struct got_error * diff_output(BUF *diffbuf, const char *fmt, ...) { + const struct got_error *err = NULL; va_list vap; int i; char *str; @@ -183,9 +184,9 @@ diff_output(BUF *diffbuf, const char *fmt, ...) va_end(vap); if (i == -1) return got_error_from_errno("vasprintf"); - buf_append(&newsize, diffbuf, str, strlen(str)); + err = buf_append(&newsize, diffbuf, str, strlen(str)); free(str); - return NULL; + return err; } static const struct got_error*