summaryrefslogtreecommitdiff
path: root/src/mc.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2022-10-24 21:03:42 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2022-10-24 21:03:42 +0200
commit532d4a24e2013262dfa41fd85c06a9715c99abf7 (patch)
tree3b7f4fac1e983ead408c20a2f330b41aa2399ab1 /src/mc.c
parenta1bdcfa3ca8af4ddb69ee57d716aa943cf3fe94a (diff)
New upstream version 4.7upstream/4.7
Diffstat (limited to 'src/mc.c')
-rw-r--r--src/mc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mc.c b/src/mc.c
index 33500e7..d16dcbb 100644
--- a/src/mc.c
+++ b/src/mc.c
@@ -79,11 +79,13 @@ EXPORT_SYMBOL hxmc_t *HXmc_memcpy(hxmc_t **vp, const void *ptr, size_t len)
if (ptr == NULL) {
ctx->length = 0;
ctx->data[0] = '\0';
+ // coverity[leaked_storage]
return *vp = ctx->data;
}
memcpy(ctx->data, ptr, ctx->length = len);
ctx->data[len] = '\0';
+ // coverity[leaked_storage]
return *vp = ctx->data;
}
@@ -123,6 +125,7 @@ EXPORT_SYMBOL hxmc_t *HXmc_trunc(hxmc_t **vp, size_t len)
ctx->data[len] = '\0';
ctx->length = len;
}
+ // coverity[leaked_storage]
return *vp = ctx->data;
}
@@ -146,11 +149,13 @@ EXPORT_SYMBOL hxmc_t *HXmc_memcat(hxmc_t **vp, const void *ptr, size_t len)
ctx->alloc = nl;
}
if (ptr == NULL)
+ // coverity[leaked_storage]
return *vp = ctx->data;
memcpy(ctx->data + ctx->length, ptr, len);
ctx->length = nl;
ctx->data[nl] = '\0';
+ // coverity[leaked_storage]
return *vp = ctx->data;
}
@@ -200,6 +205,7 @@ EXPORT_SYMBOL hxmc_t *HXmc_memins(hxmc_t **vp, size_t pos, const void *ptr,
memcpy(ctx->data + pos, ptr, len);
ctx->length += len;
ctx->data[ctx->length] = '\0';
+ // coverity[leaked_storage]
return *vp = ctx->data;
}