3 comments:
File include/osmocom/mgcp/mgcp_network.h:
Patch Set #3, Line 90: char fmtp[256];
here is that char fmtp[256], it matches the storage choice of audio_name[] above.
context: this is used in public API, also as out-parameter. Dynamic allocation would be tricky, so leave it static.
File include/osmocom/mgcp_client/mgcp_client.h:
Patch Set #3, Line 84: const char *fmtp;
I'm a bit wobbly on the storage choice. Elsewhere I put a char fmtp[256]. […]
context: structs with ptmap members are:
If a fmtp is only passed in as function arg, it is fine to be a static pointer that goes bust after the function returns.
For persistent storage, a pointer going bust would be bad.
So are any of these structs persistent?
mgcp_conn_peer is stored persistently in at least mgcp_client_endpoint_fsm.c.
It copies a value passed in from a caller outside of this library.
So indeed a static array would be safer / simpler here.
File src/libosmo-mgcp/mgcp_sdp.c:
Patch Set #3, Line 59: const char *fmtp;
here's another dynamic string...
context: this struct is used only internally in this .c file.
The storage is never persistent, always limited in a function scope.
There already is a bunch of talloc allocation with a temporary ctx, so this is fine to remain a pointer (and not impose a length limit).
To view, visit change 34900. To unsubscribe, or for help writing mail filters, visit settings.