libsysprof-capture: wrap strdup to be NULL-safe

This commit is contained in:
Christian Hergert
2020-07-02 12:16:47 -07:00
committed by Philip Withnall
parent 6a45f020f7
commit cef698e658
3 changed files with 6 additions and 4 deletions

View File

@ -73,3 +73,5 @@
if (_p != NULL) \
(destroy) (_p); \
} while (0)
#define sysprof_strdup(s) ((s) ? strdup(s) : NULL)