git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v4 06/25] reftable/record: handle allocation failures on copy

From
Patrick Steinhardt <ps@pks.im>
Date
Oct 1, 2024, 09:42 UTC
Message-ID
<756a32c28558bfaa360304712110443d643fc303.1727774935.git.ps@pks.im>
In-Reply-To
<cover.1727774935.git.ps@pks.im>

Handle allocation failures when copying records. While at it, convert from `xstrdup()` to `reftable_strdup()`. Adapt callsites to check for error codes.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 reftable/record.c | 84 +++++++++++++++++++++++++++++++++--------------
 reftable/record.h |  6 ++--
 2 files changed, 63 insertions(+), 27 deletions(-)
diff --git a/reftable/record.c b/reftable/record.c
index 6b5a075b92..60fd33c9c9 100644
--- a/reftable/record.c
+++ b/reftable/record.c
@@ -215,13 +215,14 @@ static void reftable_ref_record_key(const void *r, struct strbuf *dest)
 	strbuf_addstr(dest, rec->refname);
 }
 
-static void reftable_ref_record_copy_from(void *rec, const void *src_rec,
-					  int hash_size)
+static int reftable_ref_record_copy_from(void *rec, const void *src_rec,
+					 int hash_size)
 {
 	struct reftable_ref_record *ref = rec;
 	const struct reftable_ref_record *src = src_rec;
 	char *refname = NULL;
 	size_t refname_cap = 0;
+	int err;
 
 	assert(hash_size > 0);
 
@@ -236,6 +237,11 @@ static void reftable_ref_record_copy_from(void *rec, const void *src_rec,
 
 		REFTABLE_ALLOC_GROW(ref->refname, refname_len + 1,
 				    ref->refname_cap);
+		if (!ref->refname) {
+			err = REFTABLE_OUT_OF_MEMORY_ERROR;
+			goto out;
+		}
+
 		memcpy(ref->refname, src->refname, refname_len);
 		ref->refname[refname_len] = 0;
 	}
@@ -254,9 +260,17 @@ static void reftable_ref_record_copy_from(void *rec, const void *src_rec,
 		       src->value.val2.target_value, hash_size);
 		break;
 	case REFTABLE_REF_SYMREF:
-		ref->value.symref = xstrdup(src->value.symref);
+		ref->value.symref = reftable_strdup(src->value.symref);
+		if (!ref->value.symref) {
+			err = REFTABLE_OUT_OF_MEMORY_ERROR;
+			goto out;
+		}
 		break;
 	}
+
+	err = 0;
+out:
+	return err;
 }
 
 static void reftable_ref_record_release_void(void *rec)
@@ -457,23 +471,28 @@ static void reftable_obj_record_release(void *rec)
 	memset(obj, 0, sizeof(struct reftable_obj_record));
 }
 
-static void reftable_obj_record_copy_from(void *rec, const void *src_rec,
-					  int hash_size UNUSED)
+static int reftable_obj_record_copy_from(void *rec, const void *src_rec,
+					 int hash_size UNUSED)
 {
 	struct reftable_obj_record *obj = rec;
-	const struct reftable_obj_record *src =
-		(const struct reftable_obj_record *)src_rec;
+	const struct reftable_obj_record *src = src_rec;
 
 	reftable_obj_record_release(obj);
 
 	REFTABLE_ALLOC_ARRAY(obj->hash_prefix, src->hash_prefix_len);
+	if (!obj->hash_prefix)
+		return REFTABLE_OUT_OF_MEMORY_ERROR;
 	obj->hash_prefix_len = src->hash_prefix_len;
 	if (src->hash_prefix_len)
 		memcpy(obj->hash_prefix, src->hash_prefix, obj->hash_prefix_len);
 
 	REFTABLE_ALLOC_ARRAY(obj->offsets, src->offset_len);
+	if (!obj->offsets)
+		return REFTABLE_OUT_OF_MEMORY_ERROR;
 	obj->offset_len = src->offset_len;
 	COPY_ARRAY(obj->offsets, src->offsets, src->offset_len);
+
+	return 0;
 }
 
 static uint8_t reftable_obj_record_val_type(const void *rec)
@@ -646,33 +665,44 @@ static void reftable_log_record_key(const void *r, struct strbuf *dest)
 	strbuf_add(dest, i64, sizeof(i64));
 }
 
-static void reftable_log_record_copy_from(void *rec, const void *src_rec,
-					  int hash_size)
+static int reftable_log_record_copy_from(void *rec, const void *src_rec,
+					 int hash_size)
 {
 	struct reftable_log_record *dst = rec;
 	const struct reftable_log_record *src =
 		(const struct reftable_log_record *)src_rec;
+	int ret;
 
 	reftable_log_record_release(dst);
 	*dst = *src;
+
 	if (dst->refname) {
-		dst->refname = xstrdup(dst->refname);
+		dst->refname = reftable_strdup(dst->refname);
+		if (!dst->refname) {
+			ret = REFTABLE_OUT_OF_MEMORY_ERROR;
+			goto out;
+		}
 	}
+
 	switch (dst->value_type) {
 	case REFTABLE_LOG_DELETION:
 		break;
 	case REFTABLE_LOG_UPDATE:
-		if (dst->value.update.email) {
+		if (dst->value.update.email)
 			dst->value.update.email =
-				xstrdup(dst->value.update.email);
-		}
-		if (dst->value.update.name) {
+				reftable_strdup(dst->value.update.email);
+		if (dst->value.update.name)
 			dst->value.update.name =
-				xstrdup(dst->value.update.name);
-		}
-		if (dst->value.update.message) {
+				reftable_strdup(dst->value.update.name);
+		if (dst->value.update.message)
 			dst->value.update.message =
-				xstrdup(dst->value.update.message);
+				reftable_strdup(dst->value.update.message);
+
+		if (!dst->value.update.email ||
+		    !dst->value.update.name ||
+		    !dst->value.update.message) {
+			ret = REFTABLE_OUT_OF_MEMORY_ERROR;
+			goto out;
 		}
 
 		memcpy(dst->value.update.new_hash,
@@ -681,6 +711,10 @@ static void reftable_log_record_copy_from(void *rec, const void *src_rec,
 		       src->value.update.old_hash, hash_size);
 		break;
 	}
+
+	ret = 0;
+out:
+	return ret;
 }
 
 static void reftable_log_record_release_void(void *rec)
@@ -954,8 +988,8 @@ static void reftable_index_record_key(const void *r, struct strbuf *dest)
 	strbuf_addbuf(dest, &rec->last_key);
 }
 
-static void reftable_index_record_copy_from(void *rec, const void *src_rec,
-					    int hash_size UNUSED)
+static int reftable_index_record_copy_from(void *rec, const void *src_rec,
+					   int hash_size UNUSED)
 {
 	struct reftable_index_record *dst = rec;
 	const struct reftable_index_record *src = src_rec;
@@ -963,6 +997,8 @@ static void reftable_index_record_copy_from(void *rec, const void *src_rec,
 	strbuf_reset(&dst->last_key);
 	strbuf_addbuf(&dst->last_key, &src->last_key);
 	dst->offset = src->offset;
+
+	return 0;
 }
 
 static void reftable_index_record_release(void *rec)
@@ -1054,14 +1090,14 @@ int reftable_record_encode(struct reftable_record *rec, struct string_view dest,
 						   dest, hash_size);
 }
 
-void reftable_record_copy_from(struct reftable_record *rec,
+int reftable_record_copy_from(struct reftable_record *rec,
 			       struct reftable_record *src, int hash_size)
 {
 	assert(src->type == rec->type);
 
-	reftable_record_vtable(rec)->copy_from(reftable_record_data(rec),
-					       reftable_record_data(src),
-					       hash_size);
+	return reftable_record_vtable(rec)->copy_from(reftable_record_data(rec),
+						      reftable_record_data(src),
+						      hash_size);
 }
 
 uint8_t reftable_record_val_type(struct reftable_record *rec)
diff --git a/reftable/record.h b/reftable/record.h
index 5003bacdb0..0f53ba5443 100644
--- a/reftable/record.h
+++ b/reftable/record.h
@@ -44,7 +44,7 @@ struct reftable_record_vtable {
 	/* The record type of ('r' for ref). */
 	uint8_t type;
 
-	void (*copy_from)(void *dest, const void *src, int hash_size);
+	int (*copy_from)(void *dest, const void *src, int hash_size);
 
 	/* a value of [0..7], indicating record subvariants (eg. ref vs. symref
 	 * vs ref deletion) */
@@ -137,8 +137,8 @@ void reftable_record_init(struct reftable_record *rec, uint8_t typ);
 int reftable_record_cmp(struct reftable_record *a, struct reftable_record *b);
 int reftable_record_equal(struct reftable_record *a, struct reftable_record *b, int hash_size);
 void reftable_record_key(struct reftable_record *rec, struct strbuf *dest);
-void reftable_record_copy_from(struct reftable_record *rec,
-			       struct reftable_record *src, int hash_size);
+int reftable_record_copy_from(struct reftable_record *rec,
+			      struct reftable_record *src, int hash_size);
 uint8_t reftable_record_val_type(struct reftable_record *rec);
 int reftable_record_encode(struct reftable_record *rec, struct string_view dest,
 			   int hash_size);
-- 
2.47.0.rc0.dirty
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 95 of 151 in “reftable: handle allocation errors”
  1. 00/22 reftable: handle allocation errorsPatrick Steinhardt, Sep 16, 2024
  2. 01/22 reftable/error: introduce out-of-memory error codePatrick Steinhardt, Sep 16, 2024
  3. 02/22 reftable/basics: merge "publicbasics" into "basics"Patrick Steinhardt, Sep 16, 2024
  4. 03/22 reftable: introduce `reftable_strdup()`Patrick Steinhardt, Sep 16, 2024
  5. 04/22 reftable/basics: handle allocation failures in `reftable_calloc()`Patrick Steinhardt, Sep 16, 2024
  6. Junio C HamanoSep 21, 2024
  7. Patrick SteinhardtSep 24, 2024
  8. Patrick SteinhardtSep 24, 2024
  9. Junio C HamanoSep 24, 2024
  10. 05/22 reftable/basics: handle allocation failures in `parse_names()`Patrick Steinhardt, Sep 16, 2024
  11. 06/22 reftable/record: handle allocation failures on copyPatrick Steinhardt, Sep 16, 2024
  12. 07/22 reftable/record: handle allocation failures when decoding recordsPatrick Steinhardt, Sep 16, 2024
  13. 08/22 reftable/writer: handle allocation failures in `writer_index_hash()`Patrick Steinhardt, Sep 16, 2024
  14. 09/22 reftable/writer: handle allocation failures in `reftable_new_writer()`Patrick Steinhardt, Sep 16, 2024
  15. 10/22 reftable/merged: handle allocation failures in `merged_table_init_iter()`Patrick Steinhardt, Sep 16, 2024
  16. 11/22 reftable/reader: handle allocation failures for unindexed readerPatrick Steinhardt, Sep 16, 2024
  17. 12/22 reftable/reader: handle allocation failures in `reader_init_iter()`Patrick Steinhardt, Sep 16, 2024
  18. 13/22 reftable/stack: handle allocation failures on reloadPatrick Steinhardt, Sep 16, 2024
  19. 14/22 reftable/stack: handle allocation failures in `reftable_new_stack()`Patrick Steinhardt, Sep 16, 2024
  20. 15/22 reftable/stack: handle allocation failures in `stack_compact_range()`Patrick Steinhardt, Sep 16, 2024
  21. 16/22 reftable/stack: handle allocation failures in auto compactionPatrick Steinhardt, Sep 16, 2024
  22. 17/22 reftable/iter: handle allocation failures when creating indexed table iterPatrick Steinhardt, Sep 16, 2024
  23. Junio C HamanoSep 22, 2024
  24. Patrick SteinhardtSep 24, 2024
  25. 18/22 reftable/blocksource: handle allocation failuresPatrick Steinhardt, Sep 16, 2024
  26. 19/22 reftable/block: handle allocation failuresPatrick Steinhardt, Sep 16, 2024
  27. 20/22 reftable/pq: handle allocation failures when adding entriesPatrick Steinhardt, Sep 16, 2024
  28. 21/22 reftable/tree: handle allocation failuresPatrick Steinhardt, Sep 16, 2024
  29. 22/22 reftable: handle trivial allocation failuresPatrick Steinhardt, Sep 16, 2024
  30. 00/22 reftable: handle allocation errorsPatrick Steinhardt, Sep 24, 2024
  31. 01/22 reftable/error: introduce out-of-memory error codePatrick Steinhardt, Sep 24, 2024
  32. 02/22 reftable/basics: merge "publicbasics" into "basics"Patrick Steinhardt, Sep 24, 2024
  33. 03/22 reftable: introduce `reftable_strdup()`Patrick Steinhardt, Sep 24, 2024
  34. 04/22 reftable/basics: handle allocation failures in `reftable_calloc()`Patrick Steinhardt, Sep 24, 2024
  35. Junio C HamanoSep 24, 2024
  36. Patrick SteinhardtSep 26, 2024
  37. Junio C HamanoSep 26, 2024
  38. Patrick SteinhardtSep 27, 2024
  39. Han-Wen NienhuysSep 27, 2024
  40. Junio C HamanoSep 27, 2024
  41. 05/22 reftable/basics: handle allocation failures in `parse_names()`Patrick Steinhardt, Sep 24, 2024
  42. René ScharfeSep 24, 2024
  43. Patrick SteinhardtSep 26, 2024
  44. 06/22 reftable/record: handle allocation failures on copyPatrick Steinhardt, Sep 24, 2024
  45. 07/22 reftable/record: handle allocation failures when decoding recordsPatrick Steinhardt, Sep 24, 2024
  46. 08/22 reftable/writer: handle allocation failures in `writer_index_hash()`Patrick Steinhardt, Sep 24, 2024
  47. 09/22 reftable/writer: handle allocation failures in `reftable_new_writer()`Patrick Steinhardt, Sep 24, 2024
  48. 10/22 reftable/merged: handle allocation failures in `merged_table_init_iter()`Patrick Steinhardt, Sep 24, 2024
  49. 11/22 reftable/reader: handle allocation failures for unindexed readerPatrick Steinhardt, Sep 24, 2024
  50. 12/22 reftable/reader: handle allocation failures in `reader_init_iter()`Patrick Steinhardt, Sep 24, 2024
  51. 13/22 reftable/stack: handle allocation failures on reloadPatrick Steinhardt, Sep 24, 2024
  52. 14/22 reftable/stack: handle allocation failures in `reftable_new_stack()`Patrick Steinhardt, Sep 24, 2024
  53. 15/22 reftable/stack: handle allocation failures in `stack_compact_range()`Patrick Steinhardt, Sep 24, 2024
  54. 16/22 reftable/stack: handle allocation failures in auto compactionPatrick Steinhardt, Sep 24, 2024
  55. 17/22 reftable/iter: handle allocation failures when creating indexed table iterPatrick Steinhardt, Sep 24, 2024
  56. 18/22 reftable/blocksource: handle allocation failuresPatrick Steinhardt, Sep 24, 2024
  57. 19/22 reftable/block: handle allocation failuresPatrick Steinhardt, Sep 24, 2024
  58. 20/22 reftable/pq: handle allocation failures when adding entriesPatrick Steinhardt, Sep 24, 2024
  59. 21/22 reftable/tree: handle allocation failuresPatrick Steinhardt, Sep 24, 2024
  60. 22/22 reftable: handle trivial allocation failuresPatrick Steinhardt, Sep 24, 2024
  61. 00/22 refatble: handle allocation errorsPatrick Steinhardt, Sep 30, 2024
  62. 01/22 reftable/error: introduce out-of-memory error codePatrick Steinhardt, Sep 30, 2024
  63. 02/22 reftable/basics: merge "publicbasics" into "basics"Patrick Steinhardt, Sep 30, 2024
  64. 03/22 reftable: introduce `reftable_strdup()`Patrick Steinhardt, Sep 30, 2024
  65. 04/22 reftable/basics: handle allocation failures in `reftable_calloc()`Patrick Steinhardt, Sep 30, 2024
  66. 05/22 reftable/basics: handle allocation failures in `parse_names()`Patrick Steinhardt, Sep 30, 2024
  67. René ScharfeSep 30, 2024
  68. 06/22 reftable/record: handle allocation failures on copyPatrick Steinhardt, Sep 30, 2024
  69. 07/22 reftable/record: handle allocation failures when decoding recordsPatrick Steinhardt, Sep 30, 2024
  70. 08/22 reftable/writer: handle allocation failures in `writer_index_hash()`Patrick Steinhardt, Sep 30, 2024
  71. 09/22 reftable/writer: handle allocation failures in `reftable_new_writer()`Patrick Steinhardt, Sep 30, 2024
  72. René ScharfeSep 30, 2024
  73. Patrick SteinhardtSep 30, 2024
  74. Junio C HamanoSep 30, 2024
  75. 10/22 reftable/merged: handle allocation failures in `merged_table_init_iter()`Patrick Steinhardt, Sep 30, 2024
  76. 11/22 reftable/reader: handle allocation failures for unindexed readerPatrick Steinhardt, Sep 30, 2024
  77. 12/22 reftable/reader: handle allocation failures in `reader_init_iter()`Patrick Steinhardt, Sep 30, 2024
  78. 13/22 reftable/stack: handle allocation failures on reloadPatrick Steinhardt, Sep 30, 2024
  79. 14/22 reftable/stack: handle allocation failures in `reftable_new_stack()`Patrick Steinhardt, Sep 30, 2024
  80. 15/22 reftable/stack: handle allocation failures in `stack_compact_range()`Patrick Steinhardt, Sep 30, 2024
  81. 16/22 reftable/stack: handle allocation failures in auto compactionPatrick Steinhardt, Sep 30, 2024
  82. 17/22 reftable/iter: handle allocation failures when creating indexed table iterPatrick Steinhardt, Sep 30, 2024
  83. 18/22 reftable/blocksource: handle allocation failuresPatrick Steinhardt, Sep 30, 2024
  84. 19/22 reftable/block: handle allocation failuresPatrick Steinhardt, Sep 30, 2024
  85. 20/22 reftable/pq: handle allocation failures when adding entriesPatrick Steinhardt, Sep 30, 2024
  86. 21/22 reftable/tree: handle allocation failuresPatrick Steinhardt, Sep 30, 2024
  87. 22/22 reftable: handle trivial allocation failuresPatrick Steinhardt, Sep 30, 2024
  88. Junio C HamanoSep 30, 2024
  89. 00/25 reftable: handle allocation errorsPatrick Steinhardt, Oct 1, 2024
  90. 01/25 reftable/error: introduce out-of-memory error codePatrick Steinhardt, Oct 1, 2024
  91. 02/25 reftable/basics: merge "publicbasics" into "basics"Patrick Steinhardt, Oct 1, 2024
  92. 03/25 reftable: introduce `reftable_strdup()`Patrick Steinhardt, Oct 1, 2024
  93. 04/25 reftable/basics: handle allocation failures in `reftable_calloc()`Patrick Steinhardt, Oct 1, 2024
  94. 05/25 reftable/basics: handle allocation failures in `parse_names()`Patrick Steinhardt, Oct 1, 2024
  95. 06/25 reftable/record: handle allocation failures on copyPatrick Steinhardt, Oct 1, 2024
  96. 07/25 reftable/record: handle allocation failures when decoding recordsPatrick Steinhardt, Oct 1, 2024
  97. 08/25 reftable/writer: handle allocation failures in `writer_index_hash()`Patrick Steinhardt, Oct 1, 2024
  98. 09/25 reftable/writer: handle allocation failures in `reftable_new_writer()`Patrick Steinhardt, Oct 1, 2024
  99. 10/25 reftable/merged: handle allocation failures in `merged_table_init_iter()`Patrick Steinhardt, Oct 1, 2024
  100. 11/25 reftable/reader: handle allocation failures for unindexed readerPatrick Steinhardt, Oct 1, 2024
  101. 12/25 reftable/reader: handle allocation failures in `reader_init_iter()`Patrick Steinhardt, Oct 1, 2024
  102. 13/25 reftable/stack: handle allocation failures on reloadPatrick Steinhardt, Oct 1, 2024
  103. 14/25 reftable/stack: handle allocation failures in `reftable_new_stack()`Patrick Steinhardt, Oct 1, 2024
  104. 15/25 reftable/stack: handle allocation failures in `stack_compact_range()`Patrick Steinhardt, Oct 1, 2024
  105. 16/25 reftable/stack: handle allocation failures in auto compactionPatrick Steinhardt, Oct 1, 2024
  106. 17/25 reftable/iter: handle allocation failures when creating indexed table iterPatrick Steinhardt, Oct 1, 2024
  107. 18/25 reftable/blocksource: handle allocation failuresPatrick Steinhardt, Oct 1, 2024
  108. 19/25 reftable/block: handle allocation failuresPatrick Steinhardt, Oct 1, 2024
  109. 20/25 reftable/pq: handle allocation failures when adding entriesPatrick Steinhardt, Oct 1, 2024
  110. 21/25 reftable/tree: handle allocation failuresPatrick Steinhardt, Oct 1, 2024
  111. 22/25 reftable: handle trivial allocation failuresPatrick Steinhardt, Oct 1, 2024
  112. 23/25 reftable: fix calls to free(3P)Patrick Steinhardt, Oct 1, 2024
  113. 24/25 reftable: introduce `REFTABLE_FREE_AND_NULL()`Patrick Steinhardt, Oct 1, 2024
  114. 25/25 reftable/basics: ban standard allocator functionsPatrick Steinhardt, Oct 1, 2024
  115. Junio C HamanoOct 1, 2024
  116. Patrick SteinhardtOct 2, 2024
  117. Junio C HamanoOct 1, 2024
  118. René ScharfeOct 1, 2024
  119. Junio C HamanoOct 1, 2024
  120. Patrick SteinhardtOct 2, 2024
  121. Junio C HamanoOct 2, 2024
  122. 00/25 reftable: handle allocation errorsPatrick Steinhardt, Oct 2, 2024
  123. 01/25 reftable/error: introduce out-of-memory error codePatrick Steinhardt, Oct 2, 2024
  124. 02/25 reftable/basics: merge "publicbasics" into "basics"Patrick Steinhardt, Oct 2, 2024
  125. 03/25 reftable: introduce `reftable_strdup()`Patrick Steinhardt, Oct 2, 2024
  126. 04/25 reftable/basics: handle allocation failures in `reftable_calloc()`Patrick Steinhardt, Oct 2, 2024
  127. 05/25 reftable/basics: handle allocation failures in `parse_names()`Patrick Steinhardt, Oct 2, 2024
  128. Eric SunshineOct 2, 2024
  129. Patrick SteinhardtOct 4, 2024
  130. Eric SunshineOct 4, 2024
  131. 06/25 reftable/record: handle allocation failures on copyPatrick Steinhardt, Oct 2, 2024
  132. 07/25 reftable/record: handle allocation failures when decoding recordsPatrick Steinhardt, Oct 2, 2024
  133. 08/25 reftable/writer: handle allocation failures in `writer_index_hash()`Patrick Steinhardt, Oct 2, 2024
  134. 09/25 reftable/writer: handle allocation failures in `reftable_new_writer()`Patrick Steinhardt, Oct 2, 2024
  135. 10/25 reftable/merged: handle allocation failures in `merged_table_init_iter()`Patrick Steinhardt, Oct 2, 2024
  136. 11/25 reftable/reader: handle allocation failures for unindexed readerPatrick Steinhardt, Oct 2, 2024
  137. 12/25 reftable/reader: handle allocation failures in `reader_init_iter()`Patrick Steinhardt, Oct 2, 2024
  138. 13/25 reftable/stack: handle allocation failures on reloadPatrick Steinhardt, Oct 2, 2024
  139. 14/25 reftable/stack: handle allocation failures in `reftable_new_stack()`Patrick Steinhardt, Oct 2, 2024
  140. 15/25 reftable/stack: handle allocation failures in `stack_compact_range()`Patrick Steinhardt, Oct 2, 2024
  141. 16/25 reftable/stack: handle allocation failures in auto compactionPatrick Steinhardt, Oct 2, 2024
  142. 17/25 reftable/iter: handle allocation failures when creating indexed table iterPatrick Steinhardt, Oct 2, 2024
  143. 18/25 reftable/blocksource: handle allocation failuresPatrick Steinhardt, Oct 2, 2024
  144. 19/25 reftable/block: handle allocation failuresPatrick Steinhardt, Oct 2, 2024
  145. 20/25 reftable/pq: handle allocation failures when adding entriesPatrick Steinhardt, Oct 2, 2024
  146. 21/25 reftable/tree: handle allocation failuresPatrick Steinhardt, Oct 2, 2024
  147. 22/25 reftable: handle trivial allocation failuresPatrick Steinhardt, Oct 2, 2024
  148. 23/25 reftable: fix calls to free(3P)Patrick Steinhardt, Oct 2, 2024
  149. 24/25 reftable: introduce `REFTABLE_FREE_AND_NULL()`Patrick Steinhardt, Oct 2, 2024
  150. 25/25 reftable/basics: ban standard allocator functionsPatrick Steinhardt, Oct 2, 2024
  151. Junio C HamanoOct 2, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.