The way you have it designed, the caller *must* allocate the space; the callee *cannot* allocate it:
bool updateInfo(struct INFO* pInfo)
void someOtherProc ()
struct INFO *p = (struct INFO *)malloc (sizeof (struct INFO));
if (p != NULL)
Suppose you did the "malloc()" inside updateInfo()? How is the caller going to get the new pointer, the one returned by "malloc()"? Certainly not through the "pInfo" parameter. You can change the *local* value of "pInfo" in "updateInfo()" ... but you cannot return the new value back to the caller.
Two alternatives might be:
a) make pInfo a pointer to a pointer ("struct INFO **ppInfo")
... or ...
b) make "udpateInfo()" return the pointer (instead of a "bool").
If your function simply "updates existing data", then like your original design better. Just allocate the struct before you call "updateInfo()", and Life is Good.
Otherwise, if your function is actually "add new member to list", then I'd allocate inside the function ... and pass a pointer to a pointer. Here's an example:
IMHO .. PSM