Example—the Motif library. Motif is a legacy library, part of the X Window System; it was used (and perhaps still is) to develop GUIs for Unix (and Unix-like) systems.
For the purpose of this example, we will focus on one of its APIs: XmStringCreateLocalized(3). GUI developers use this function to create what Motif calls a "compound string"—essentially, just a string that holds text in a specific locale (for the purposes of I18N-internationalization). This is its signature:
#include <Xm/Xm.h>
XmString XmStringCreateLocalized(char *text);
So, let's imagine the developer uses it to generate compound strings (for various purposes; very often, for the labels of a label or push button widget).
So, what's the problem? Leakage! How? ...