• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mendersoftware / mender-mcu / 1898808013

30 Jun 2025 10:17PM UTC coverage: 57.26% (-0.1%) from 57.395%
1898808013

push

gitlab-ci

elkoniu
feat: Add backup root cert to Zephyr certs chain

For disaster recovery and emergency having single certificate is risky.
This change introduces 2nd root certificate to be used on the platform.

Changelog: Add backup root cert to the Zephyr certs chain
Ticket: MEN-8494
Signed-off-by: Paweł Poławski <pawel.polawski@northern.tech>

2295 of 4008 relevant lines covered (57.26%)

71.18 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/core/alloc.c
1
/**
2
 * @file      alloc.c
3
 * @brief     Platform-independent parts of the Mender memory management implementation
4
 *
5
 * Copyright Northern.tech AS
6
 *
7
 * Licensed under the Apache License, Version 2.0 (the "License");
8
 * you may not use this file except in compliance with the License.
9
 * You may obtain a copy of the License at
10
 *
11
 *     http://www.apache.org/licenses/LICENSE-2.0
12
 *
13
 * Unless required by applicable law or agreed to in writing, software
14
 * distributed under the License is distributed on an "AS IS" BASIS,
15
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
 * See the License for the specific language governing permissions and
17
 * limitations under the License.
18
 */
19

20
#include <stdlib.h> /* malloc(),... */
21
#include <string.h> /* memset() */
22

23
#include "alloc.h"
24

25
static MenderAllocator   malloc_fn  = NULL;
26
static MenderReallocator realloc_fn = NULL;
27
static MenderDeallocator free_fn    = NULL;
28

29
void
30
mender_set_allocation_funcs(MenderAllocator malloc_func, MenderReallocator realloc_func, MenderDeallocator free_func) {
29✔
31
    malloc_fn  = malloc_func;
29✔
32
    realloc_fn = realloc_func;
29✔
33
    free_fn    = free_func;
29✔
34
}
29✔
35

36
void *
37
mender_malloc(size_t size) {
8,455✔
38
    if (NULL == malloc_fn) {
8,455✔
39
        return malloc(size);
419✔
40
    }
41
    return malloc_fn(size);
8,036✔
42
}
43

44
void *
45
mender_calloc(size_t n, size_t size) {
550✔
46
    void *ret = mender_malloc(n * size);
550✔
47
    if (NULL != ret) {
550✔
48
        memset(ret, 0, n * size);
550✔
49
    }
50
    return ret;
550✔
51
}
52

53
void *
54
mender_realloc(void *ptr, size_t size) {
286✔
55
    if (NULL == realloc_fn) {
286✔
56
        return realloc(ptr, size);
29✔
57
    }
58
    return realloc_fn(ptr, size);
257✔
59
}
60

61
void
62
mender_free(void *ptr) {
8,674✔
63
    if (NULL == free_fn) {
8,674✔
64
        free(ptr);
542✔
65
        return;
542✔
66
    }
67
    free_fn(ptr);
8,132✔
68
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc