summaryrefslogtreecommitdiff
path: root/send-pack.c
diff options
context:
space:
mode:
Diffstat (limited to 'send-pack.c')
-rw-r--r--send-pack.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/send-pack.c b/send-pack.c
index 86592ce526..67d6987b1c 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -4,7 +4,7 @@
#include "date.h"
#include "gettext.h"
#include "hex.h"
-#include "object-store.h"
+#include "odb.h"
#include "pkt-line.h"
#include "sideband.h"
#include "run-command.h"
@@ -45,7 +45,7 @@ int option_parse_push_signed(const struct option *opt,
static void feed_object(struct repository *r,
const struct object_id *oid, FILE *fh, int negative)
{
- if (negative && !has_object(r, oid, 0))
+ if (negative && !odb_has_object(r->objects, oid, 0))
return;
if (negative)
@@ -257,6 +257,13 @@ static int receive_status(struct repository *r,
refname);
continue;
}
+
+ /*
+ * Clients sending duplicate refs can cause the same value
+ * to be overridden, causing a memory leak.
+ */
+ free(hint->remote_status);
+
if (!strcmp(head, "ng")) {
hint->status = REF_STATUS_REMOTE_REJECT;
if (p)