commit c945ec50da8b849eeb8e82b3836fc106bc041419 from: Stefan Sperling date: Sat Nov 17 14:52:59 2018 UTC init output param in {parse,read}_object_header commit - 13f977b46069aaea2cc3228fa7667772c7eb7ac0 commit + c945ec50da8b849eeb8e82b3836fc106bc041419 blob - 2d71593449dcec3346db75b88284633ceb55db6d blob + 7738a57cd9ee8350a5e72c39a576e5b654aa263c --- libexec/got-read-object/got-read-object.c +++ libexec/got-read-object/got-read-object.c @@ -72,6 +72,8 @@ parse_object_header(struct got_object **obj, char *buf int i; char *p = strchr(buf, '\0'); + *obj = NULL; + if (p == NULL) return got_error(GOT_ERR_BAD_OBJ_HDR); @@ -116,6 +118,8 @@ read_object_header(struct got_object **obj, int fd) size_t outlen, totlen; int nbuf = 1; + *obj = NULL; + buf = malloc(zbsize); if (buf == NULL) return got_error_from_errno();