You shouldn't new or malloc unless you need to. The more you allocate the more you leak.
Just stack/automatically allocate the resource and take the address with & then pass the pointer around. Because the data is automatically cleaned up you know you won't have any leaks (and certain whole other classes of bugs).
EDIT - Consider:
int myDictLen = 0;
int* myDictLenPtr = &myDictLen;
/* now you can pass around the pointer myDictLenPtr
to functions that can used an int* and it will be
available in this scope and automatically cleaned
up for you. */
If a function takes an argument of type pointer-to-int, you can simply pass a reference to an int variable on the stack with "&myInt". The code in question seems to be using heap allocation just to get a pointer-to-int, which makes one suspect that the author doesn't know about the & operator.
Just stack/automatically allocate the resource and take the address with & then pass the pointer around. Because the data is automatically cleaned up you know you won't have any leaks (and certain whole other classes of bugs).
EDIT - Consider: