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

jcbf / smf-spf / 21120233602

18 Jan 2026 11:10PM UTC coverage: 14.381% (-0.5%) from 14.867%
21120233602

Pull #106

github

web-flow
Merge be3e4dbae into 6baf0fe8d
Pull Request #106: Fix/logto stderr error

95 of 387 new or added lines in 6 files covered. (24.55%)

3 existing lines in 1 file now uncovered.

108 of 751 relevant lines covered (14.38%)

0.24 hits per line

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

0.0
/src/utils/memory.c
1
/*
2
 * memory.c - Memory safety utilities for smf-spf
3
 *
4
 * This file is part of smf-spf.
5
 *
6
 * smf-spf is free software; you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation; either version 2 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * smf-spf is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 */
16

17
#include "memory.h"
18
#include "logging.h"
19
#include <string.h>
20

NEW
21
void *safe_calloc(size_t count, size_t size) {
×
NEW
22
    void *ptr = calloc(count, size);
×
23

NEW
24
    if (!ptr && count > 0 && size > 0) {
×
NEW
25
        log_message(LOG_ERR, "Memory allocation failed: calloc(%zu, %zu)",
×
26
                    count, size);
27
    }
28

NEW
29
    return ptr;
×
30
}
31

NEW
32
char *safe_strdup(const char *str) {
×
33
    char *dup;
34

NEW
35
    if (!str) {
×
36
        return NULL;
37
    }
38

NEW
39
    dup = strdup(str);
×
NEW
40
    if (!dup) {
×
NEW
41
        log_message(LOG_ERR, "Memory allocation failed: strdup");
×
42
    }
43

44
    return dup;
45
}
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