summaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
Diffstat (limited to 'camera')
-rw-r--r--camera/src/camera_metadata.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/camera/src/camera_metadata.c b/camera/src/camera_metadata.c
index e99abc4..f33da8d 100644
--- a/camera/src/camera_metadata.c
+++ b/camera/src/camera_metadata.c
@@ -234,7 +234,7 @@ camera_metadata_t *allocate_copy_camera_metadata_checked(
return NULL;
}
- void *buffer = malloc(src_size);
+ void *buffer = calloc(1, src_size);
memcpy(buffer, src, src_size);
camera_metadata_t *metadata = (camera_metadata_t*) buffer;
@@ -251,7 +251,7 @@ camera_metadata_t *allocate_camera_metadata(size_t entry_capacity,
size_t memory_needed = calculate_camera_metadata_size(entry_capacity,
data_capacity);
- void *buffer = malloc(memory_needed);
+ void *buffer = calloc(1, memory_needed);
camera_metadata_t *metadata = place_camera_metadata(
buffer, memory_needed, entry_capacity, data_capacity);
if (!metadata) {