Files
NetworkManager/shared
Thomas Haller fbddd27e73 shared: fix type shenanigans for data pointer of nm_memdup_maybe_a()
The type of the "data" pointer may not be compatible with the type of
the "to_free" / output pointer. This is due to constness, and that we
are unable in C to remove constness from a type.

For example,

    {
        const char *const *data = ...;
        gs_free const char **cpy_to_free = NULL;
        const char **cpy;

        cpy = nm_memdup_maybe_a (300, data, NM_PTRARRAY_LEN (data) + 1, &cpy_to_free);
    }

is prefectly valid , but would not have compiled.

It shows that "data" is not of type "*(&cpy_to_free)", but rather
it might be a non-const pointer of the same type.

Fixes: d0e1d0e626 ('shared: propagate types in nm_malloc_maybe_a(), nm_malloc0_maybe_a(), nm_memdup_maybe_a()')
2019-05-16 11:42:16 +02:00
..
2019-04-14 17:22:04 +02:00
2019-04-14 17:23:01 +02:00
2019-04-14 17:23:25 +02:00
2019-04-14 17:23:50 +02:00
2019-04-16 15:52:27 +02:00