commit - 34f2577ca95d182c98ef00e93d05f4fa1b559094
commit + c0cbb5f423a2a6324675956dc85b4090cf70a34c
blob - 68471e1487ff2ce6b1a6a73c6b425eb0a580341f
blob + 5f1c310ce05497519a9838e46b29d28af595d0b4
--- lib/diffreg.c
+++ lib/diffreg.c
{
const struct got_error *err;
+ if (diffreg_result == NULL)
+ return NULL;
+
diff_result_free(diffreg_result->result);
diff_data_free(&diffreg_result->left);
diff_data_free(&diffreg_result->right);
free(diffreg_result);
return err;
}
-
-const struct got_error *
-got_diffreg_result_free_left(struct got_diffreg_result *diffreg_result)
-{
- diff_data_free(&diffreg_result->left);
- memset(&diffreg_result->left, 0, sizeof(diffreg_result->left));
- return got_diffreg_close(diffreg_result->map1, diffreg_result->size1,
- NULL, 0);
-}
-
-const struct got_error *
-got_diffreg_result_free_right(struct got_diffreg_result *diffreg_result)
-{
- diff_data_free(&diffreg_result->right);
- memset(&diffreg_result->right, 0, sizeof(diffreg_result->right));
- return got_diffreg_close(NULL, 0, diffreg_result->map2,
- diffreg_result->size2);
-}
blob - 8aae9cbb204baa3c88860e324853c5f81cc36b56
blob + 3557dccae5546b2e9c1b4b688ba94f8a3946ce46
--- lib/got_lib_diff.h
+++ lib/got_lib_diff.h
struct got_diffreg_result *, int, int, const char *, const char *,
enum got_diff_output_format, int, FILE *);
const struct got_error *got_diffreg_result_free(struct got_diffreg_result *);
-const struct got_error *got_diffreg_result_free_left(
- struct got_diffreg_result *);
-const struct got_error *got_diffreg_result_free_right(
- struct got_diffreg_result *);
const struct got_error *got_diffreg_close(char *, size_t, char *, size_t);
const struct got_error *got_merge_diff3(int *, int, FILE *, FILE *, FILE *,