commit - 99f7567eaa6fad9b271f55d1469fcd383bb13205
commit + e62fc5205c7c439d072229d8be922ea30e8d8024
blob - b9fe3f13bee15721a2972403a9e9e692dafb6531
blob + 890220f4bbc04471e5b17866775b2696968d025b
--- 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;