libtt: Resolve coverity warnings
This commit is contained in:
@@ -426,9 +426,8 @@ _ttds_file_server(const char *filename, const char **hostname)
|
||||
_Tt_string hostname_s;
|
||||
_Tt_string partition;
|
||||
_Tt_string network_path;
|
||||
|
||||
*hostname = "";
|
||||
if (filename==0 || hostname==0) {
|
||||
|
||||
if (filename == NULL || hostname == NULL) {
|
||||
return TT_ERR_POINTER;
|
||||
}
|
||||
filename_s = filename;
|
||||
|
||||
@@ -2476,7 +2476,7 @@ _tt_message_context_bval(Tt_message m, const char *slotname,
|
||||
}
|
||||
*len = value.len();
|
||||
*val = (unsigned char *)_tt_strdup( value, *len );
|
||||
if (val == 0) {
|
||||
if (*val == NULL) {
|
||||
return TT_ERR_NOMEM;
|
||||
}
|
||||
return TT_OK;
|
||||
|
||||
@@ -291,6 +291,8 @@ write_auth_file(char *filename)
|
||||
else
|
||||
(void) unlink(tmpnam);
|
||||
|
||||
free(tmpnam);
|
||||
|
||||
return TT_OK;
|
||||
}
|
||||
Tt_status _Tt_auth::
|
||||
@@ -306,7 +308,10 @@ retrieve_auth_cookie()
|
||||
return TT_AUTHFILE_ENTRY_MISSING;
|
||||
|
||||
buff = (char*) malloc(entry->auth_data_length + 1);
|
||||
if (NULL == buff) return TT_ERR_NOMEM;
|
||||
if (NULL == buff) {
|
||||
_tt_FreeAuthFileEntry(entry);
|
||||
return TT_ERR_NOMEM;
|
||||
}
|
||||
|
||||
strncpy(buff, entry->auth_data, entry->auth_data_length);
|
||||
buff[entry->auth_data_length] = '\0';
|
||||
|
||||
Reference in New Issue
Block a user