More argument checking
This commit is contained in:
parent
5d6d2e499f
commit
f55c6cfdff
|
@ -93,6 +93,12 @@ AppTransport * apptransport_new(AppTransportMode mode,
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "DEBUG: %s(\"%s\", \"%s\")\n", __func__, plugin, name);
|
fprintf(stderr, "DEBUG: %s(\"%s\", \"%s\")\n", __func__, plugin, name);
|
||||||
#endif
|
#endif
|
||||||
|
/* check the arguments */
|
||||||
|
if(name == NULL || name[0] == '\0')
|
||||||
|
{
|
||||||
|
error_set_code(1, "%s", "Invalid transport");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
/* allocate the transport */
|
/* allocate the transport */
|
||||||
if((transport = object_new(sizeof(*transport))) == NULL)
|
if((transport = object_new(sizeof(*transport))) == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user