if (rec==NULL)
return TRP_BADTYPE;
+ if ((trp_inforec_get_comm(rec)==NULL)
+ || (trp_inforec_get_realm(rec)==NULL)
+ || (trp_inforec_get_trust_router(rec)==NULL)) {
+ return TRP_ERROR;
+ }
+
s=tr_name_strdup(trp_inforec_get_comm(rec));
if (s==NULL)
return TRP_NOMEM;
goto cleanup;
talloc_free(s); s=NULL;
+ trp_inforec_set_next_hop(rec, NULL); /* make sure this is null (filled in later) */
+
rc=tr_msg_get_json_integer(jrecord, "metric", &num);
if ((rc != TRP_SUCCESS) || (TRP_SUCCESS!=trp_inforec_set_metric(rec,num)))
goto cleanup;
if (jbody==NULL)
return NULL;
+ if ((NULL==trp_req_get_comm(req))
+ || (NULL==trp_req_get_realm(req))) {
+ json_decref(jbody);
+ return NULL;
+ }
+
s=tr_name_strdup(trp_req_get_comm(req)); /* ensures null termination */
if (s==NULL) {
json_decref(jbody);