aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mate
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2012-06-05 15:20:31 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2012-06-05 15:20:31 +0000
commit8204b904b3b5b20d90b83b143be997d441724907 (patch)
treeca5e31fa793e18299df1e6b5b94f565ced593b55 /plugins/mate
parent49c359bf2dc65cbc648ac0811d2aee261851335d (diff)
Fix Coverity 702421: Handle the possibility that fvalue_to_string_repr()
may return NULL. svn path=/trunk/; revision=43114
Diffstat (limited to 'plugins/mate')
-rw-r--r--plugins/mate/mate_util.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/mate/mate_util.c b/plugins/mate/mate_util.c
index 4b6755ef09..5423e72b08 100644
--- a/plugins/mate/mate_util.c
+++ b/plugins/mate/mate_util.c
@@ -311,11 +311,16 @@ extern void avp_init(void) {
extern AVP* new_avp_from_finfo(const gchar* name, field_info* finfo) {
AVP* new = (AVP*)g_slice_new(any_avp_type);
gchar* value;
+ gchar* repr = NULL;
new->n = scs_subscribe(avp_strings, name);
if (finfo->value.ftype->val_to_string_repr) {
- value = scs_subscribe(avp_strings, fvalue_to_string_repr(&finfo->value,FTREPR_DISPLAY,NULL));
+ repr = fvalue_to_string_repr(&finfo->value,FTREPR_DISPLAY,NULL);
+ }
+
+ if (repr) {
+ value = scs_subscribe(avp_strings, repr);
#ifdef _AVP_DEBUGGING
dbg_print (dbg_avp,2,dbg_fp,"new_avp_from_finfo: from string: %s",value);
#endif