dtcm: Coverity 89502
authorPeter Howkins <flibble@users.sf.net>
Wed, 4 Jul 2018 23:00:57 +0000 (00:00 +0100)
committerPeter Howkins <flibble@users.sf.net>
Wed, 4 Jul 2018 23:00:57 +0000 (00:00 +0100)
cde/programs/dtcm/dtcm/blist.c

index aee694e494ec897a0d6d90b9e639d98d0be744da..98139a739ba6be50ffa8f37f4a71d2e519b6e3c1 100644 (file)
@@ -453,8 +453,14 @@ blist_init_names(Calendar *c) {
        blist_name_append(c, get_char_prop(p, CP_DEFAULTCAL), BLIST_ACTIVE);
 
         namelist = cm_strdup(get_char_prop(p, CP_DAYCALLIST));
-        if (namelist == NULL || *namelist == '\0' )
+       if(namelist == NULL) {
                return;
+       }
+
+       if(*namelist == '\0') {
+               free(namelist);
+               return;
+       }
 
        name = strtok(namelist, " ");
        while (name) {