1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

libtt: Fixes for Coverity fixes that I thought I'd already fixed.

This commit is contained in:
Peter Howkins 2018-04-24 00:05:56 +01:00
parent d52e9390ec
commit 9088d6b54e
8 changed files with 11 additions and 2 deletions

View file

@ -45,7 +45,7 @@ declare_ptr_to(_Tt_api_stg_stack)
class _Tt_api_stg_stack_elm : public _Tt_object { class _Tt_api_stg_stack_elm : public _Tt_object {
public: public:
_Tt_api_stg_stack_elm() { addr = NULL; }; _Tt_api_stg_stack_elm() { addr = NULL; entry_type = STACK_MARK; };
~_Tt_api_stg_stack_elm(); ~_Tt_api_stg_stack_elm();
enum {STACK_MARK, STACK_STORAGE} entry_type; enum {STACK_MARK, STACK_STORAGE} entry_type;
caddr_t addr; caddr_t addr;

View file

@ -52,6 +52,9 @@ _Tt_client_isam_file::_Tt_client_isam_file (const _Tt_string &file,
else { else {
getStatusInfo(); getStatusInfo();
} }
maxRecordLength = 0;
minRecordLength = 0;
} }
_Tt_client_isam_file _Tt_client_isam_file
@ -82,6 +85,8 @@ _Tt_client_isam_file
} }
if (fileDescriptor != -1) { if (fileDescriptor != -1) {
currentRecordLength = 0;
currentRecordNumber = 0;
getISAMFileInfo(); getISAMFileInfo();
} }
else { else {

View file

@ -280,6 +280,7 @@ write_auth_file(char *filename)
_tt_syslog(0, LOG_ERR, _tt_syslog(0, LOG_ERR,
"%s: unable to open tmp file \"%s\"\n", "%s: unable to open tmp file \"%s\"\n",
funcname, tmpnam); funcname, tmpnam);
free(tmpnam);
return TT_AUTHFILE_ACCESS; return TT_AUTHFILE_ACCESS;
} }

View file

@ -527,6 +527,7 @@ entry(const char *argskey, _Tt_entry_pt func, ...)
if (arg_index < 0 || msg_args.is_null() || if (arg_index < 0 || msg_args.is_null() ||
msg_args->count() <= arg_index) { msg_args->count() <= arg_index) {
va_end(ap);
return TT_ERR_NUM; return TT_ERR_NUM;
} }
} else { } else {

View file

@ -78,6 +78,7 @@ _tt_log_error(int errno, int line, char *file, char *msg)
} }
/* Close on exec */ /* Close on exec */
if(fcntl(fileno(fl), F_SETFD, 1) == -1) { if(fcntl(fileno(fl), F_SETFD, 1) == -1) {
fclose(fl);
return; return;
} }

View file

@ -648,7 +648,6 @@ _create_datfile(isfname)
fd = open (namebuf, O_CREAT | O_EXCL | O_RDWR, 0666); fd = open (namebuf, O_CREAT | O_EXCL | O_RDWR, 0666);
if (fd > -1) { if (fd > -1) {
fcntl(fd, F_SETFD, 1); /* Close on exec */
/* Close on exec */ /* Close on exec */
if(fcntl(fd, F_SETFD, 1) == -1) { if(fcntl(fd, F_SETFD, 1) == -1) {
close(fd); close(fd);

View file

@ -318,6 +318,7 @@ isrepair(isfname, verbose)
(void)sigprocmask(SIG_SETMASK, &oldmask, NULL); (void)sigprocmask(SIG_SETMASK, &oldmask, NULL);
print("...File repaired\n"); print("...File repaired\n");
if (buffer != Buffer) free(buffer);
return (ISOK); return (ISOK);
ERROR: ERROR:

View file

@ -97,6 +97,7 @@ _Tt_signature(_Tt_signature_ptr sig)
_otid = sig->_otid; _otid = sig->_otid;
_super_otid = sig->_super_otid; _super_otid = sig->_super_otid;
_timestamp = sig->_timestamp; _timestamp = sig->_timestamp;
ce_entry = NULL;
} }
bool_t _Tt_signature:: bool_t _Tt_signature::