out->number_of_parameter = 1;
out->array_of_parameter = ( parameter* ) malloc ( sizeof ( parameter ) );
+ if (out->array_of_parameter == NULL) {
+ out->number_of_parameter = 0;
+ PLUGIN_LOG("failed to allocate memory for the parameter\n");
+ return PLUGIN_CMD_FAIL;
+ }
out->array_of_parameter[0].type = type_int32;
out->array_of_parameter[0].v_int32 = ( plugin_pwlocked() == 1 ) ? PLUGIN_RET_ON : PLUGIN_RET_OFF;
int pwlocked = plugin_pwlocked();
parameters* out = ( parameters* ) malloc ( sizeof ( parameters ) );
+ if (out == NULL) {
+ PLUGIN_LOG("failed to allocate memory for the parameter\n");
+ return;
+ }
out->number_of_parameter = 1;
out->array_of_parameter = ( parameter* ) malloc ( sizeof ( parameter ) );
+ if (out->array_of_parameter == NULL) {
+ PLUGIN_LOG("failed to allocate memory for the parameter\n");
+ free(out);
+ return;
+ }
out->array_of_parameter[0].type = type_int32;
out->array_of_parameter[0].v_int32 = ( pwlocked == 1 ) ? PLUGIN_RET_ON : PLUGIN_RET_OFF;