mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
dtinfo: fix coverity issues related to null checks after dereference
This commit is contained in:
parent
2b15c4057e
commit
bc28c20524
6 changed files with 24 additions and 22 deletions
|
@ -70,29 +70,33 @@ base::base(object_dict* obj_dict,
|
|||
num_cset_ptrs(0), num_list_ptrs(0),
|
||||
f_obj_dict(obj_dict)
|
||||
{
|
||||
if ( base_dir ) {
|
||||
int len = MIN(strlen(base_dir), PATHSIZ - 1);
|
||||
if ( base_dir )
|
||||
*((char *) memcpy (base_path, base_dir, len) + len) = '\0';
|
||||
else
|
||||
} else {
|
||||
base_path[0] = 0;
|
||||
}
|
||||
|
||||
len = MIN(strlen(base_nm), PATHSIZ - 1);
|
||||
if ( base_nm )
|
||||
if ( base_nm ) {
|
||||
int len = MIN(strlen(base_nm), PATHSIZ - 1);
|
||||
*((char *) memcpy (base_name, base_nm, len) + len) = '\0';
|
||||
else
|
||||
} else {
|
||||
base_name[0] = 0;
|
||||
}
|
||||
|
||||
len = MIN(strlen(base_ds), PATHSIZ - 1);
|
||||
if ( base_ds )
|
||||
if ( base_ds ) {
|
||||
int len = MIN(strlen(base_ds), PATHSIZ - 1);
|
||||
*((char *) memcpy (base_desc, base_ds, len) + len) = '\0';
|
||||
else
|
||||
} else {
|
||||
base_desc[0] = 0;
|
||||
}
|
||||
|
||||
len = MIN(strlen(base_uid_str), UIDSIZ - 1);
|
||||
if ( base_uid_str )
|
||||
if ( base_uid_str ) {
|
||||
int len = MIN(strlen(base_uid_str), UIDSIZ - 1);
|
||||
*((char *) memcpy (base_uid, base_uid_str, len) + len) = '\0';
|
||||
else
|
||||
} else {
|
||||
base_uid[0] = 0;
|
||||
}
|
||||
|
||||
if ( set_nms )
|
||||
while ( info_base_set_names[num_cset_ptrs] )
|
||||
|
|
|
@ -72,11 +72,12 @@ debug(cerr, base_dir);
|
|||
debug(cerr, base_nm);
|
||||
debug(cerr, base_ds);
|
||||
*/
|
||||
if (base_locale) {
|
||||
int len = MIN(strlen(base_locale), PATHSIZ - 1);
|
||||
if (base_locale)
|
||||
*((char *) memcpy (info_base_locale, base_locale, len) + len) = '\0';
|
||||
else
|
||||
} else {
|
||||
*info_base_locale = 0;
|
||||
}
|
||||
|
||||
char* nm ;
|
||||
int i;
|
||||
|
|
|
@ -530,7 +530,6 @@ highlight_search_hit(_DtCvSegment* seg, unsigned int vcc, unsigned int len)
|
|||
}
|
||||
DtCvStrVcLenSync(seg);
|
||||
|
||||
if (sibling->handle.string.string)
|
||||
free (sibling->handle.string.string);
|
||||
if (sibling->client_use) {
|
||||
delete (SegClientData*)sibling->client_use;
|
||||
|
|
|
@ -129,7 +129,6 @@ build_bc_url(UAS_String bookcase_path)
|
|||
fprintf(stderr, "(DEBUG) URL=\"%s\"\n", (char*)bc_locator);
|
||||
#endif
|
||||
|
||||
if (bc_path)
|
||||
free(bc_path);
|
||||
|
||||
return bc_locator;
|
||||
|
|
|
@ -77,7 +77,7 @@ AusText::~AusText()
|
|||
{
|
||||
store->deActivateZone ( f_base );
|
||||
|
||||
if ( store ) { delete store; }
|
||||
delete store;
|
||||
if ( f_search_store ) { delete f_search_store; }
|
||||
}
|
||||
|
||||
|
|
|
@ -828,7 +828,6 @@ makeAbsPathEnv(char *var)
|
|||
snprintf(newVar, pathlen, "%s=%s", var, newPath);
|
||||
putenv(newVar);
|
||||
|
||||
if (newPath)
|
||||
XtFree(newPath);
|
||||
|
||||
return newVar;
|
||||
|
|
Loading…
Reference in a new issue