commit - 345f650943608219909e5b5b0e5d77c4c9ca26bb
commit + b1fad72fdca8c2a237161cac88778e31a58bccb1
blob - 2d666ed27a880d2f0d3809c5a2e9f56c721952a3
blob + cc7e1998317d976ae382059d27ef242fea2d6cb0
--- lib/pack.c
+++ lib/pack.c
err = got_delta_get_sizes(&base_size, &result_size,
delta_buf, delta_len);
- if (err)
+ if (err) {
+ if (!cached)
+ free(delta_buf);
goto done;
+ }
if (base_size > max_size)
max_size = base_size;
if (result_size > max_size)
base_file);
if (w != base_bufsz) {
err = got_ferror(outfile, GOT_ERR_IO);
+ if (!cached)
+ free(delta_buf);
goto done;
}
free(base_buf);
uint8_t *p = realloc(base_buf, max_size);
if (p == NULL) {
err = got_error_from_errno("realloc");
+ if (!cached)
+ free(delta_buf);
goto done;
}
base_buf = p;
uint8_t *p = realloc(accum_buf, max_size);
if (p == NULL) {
err = got_error_from_errno("realloc");
+ if (!cached)
+ free(delta_buf);
goto done;
}
accum_buf = p;
err = got_delta_get_sizes(&base_size, &result_size,
delta_buf, delta_len);
- if (err)
+ if (err) {
+ if (!cached)
+ free(delta_buf);
goto done;
+ }
if (base_size > max_size)
max_size = base_size;
if (result_size > max_size)
uint8_t *p = realloc(base_buf, max_size);
if (p == NULL) {
err = got_error_from_errno("realloc");
+ if (!cached)
+ free(delta_buf);
goto done;
}
base_buf = p;
uint8_t *p = realloc(accum_buf, max_size);
if (p == NULL) {
err = got_error_from_errno("realloc");
+ if (!cached)
+ free(delta_buf);
goto done;
}
accum_buf = p;