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

nasa / trick / 21039148268

15 Jan 2026 04:46PM UTC coverage: 55.67% (-0.2%) from 55.875%
21039148268

Pull #1965

github

web-flow
Merge b6d3aa7f1 into 36fe2139e
Pull Request #1965: 1964 methods return size one pointers

91 of 128 new or added lines in 3 files covered. (71.09%)

1022 existing lines in 21 files now uncovered.

12573 of 22585 relevant lines covered (55.67%)

299072.13 hits per line

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

90.0
/trick_source/sim_services/MemoryManager/ref_free.cpp
1
/*
2
   PURPOSE: (Frees allocated memory within a REF2 structure. Does not free the REF2 itself)
3
   PROGRAMMERS: (((Alex Lin) (NASA) (5/13)))
4
*/
5

6
#include <stdlib.h>
7

8
#include "trick/reference.h"
9
#include "trick/dllist.h"
10

11
extern "C" void ref_free(REF2 * ref) {
637✔
12
    if ( ref ) {
637✔
13
        if ( ref->address_path ) {
631✔
14
            DLLPOS pos = DLL_GetHeadPosition(ref->address_path);
553✔
15
            DLLPOS prev = NULL;
553✔
16
            while (pos != NULL) {
1,106✔
17
                prev = pos;
553✔
18
                // The address nodes were allocated with "new"
19
                delete (ADDRESS_NODE *)DLL_GetNext(&pos, ref->address_path);
553✔
20
                DLL_RemoveAt(prev, ref->address_path);
553✔
21
            }
22
            DLL_Delete(ref->address_path) ;
553✔
23
        }
24

25
        // The reference string was allocated with strdup.
26
        if ( ref->reference ) {
631✔
27
            free(ref->reference) ;
631✔
28
            ref->reference = NULL;
631✔
29
        }
30

31
        // Free units string
32
        if (ref->units) {
631✔
33
            free(ref->units);
1✔
34
            ref->units = NULL;
1✔
35
        }
36

37
        // Free ref_attr, however, not freeing the shared attr
38
        if (ref->ref_attr) {
631✔
UNCOV
39
            free(ref->ref_attr);
×
UNCOV
40
            ref->ref_attr = NULL;
×
41
        }
42
    }
43
    return ;
637✔
44
}
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