- Timestamp:
- Oct 31, 2009, 8:53:58 PM (15 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_cat.c
r206 r257 260 260 { MSG_MSTAMP, SH_ERR_STAMP, STAMP, N_("msg=\"Memory used: max.=%lu, current=%lu\"")}, 261 261 { MSG_MSTAMP2, SH_ERR_STAMP, STAMP, N_("msg=\"Blocks: %d allocated, %d freed, %d maximum\"")}, 262 { MSG_E_MNULL, SH_ERR_ERR, ERR, N_("msg=\"Dereferenced NULL pointer \" source_file=\"%s\" source_line=\"%d\"")},262 { MSG_E_MNULL, SH_ERR_ERR, ERR, N_("msg=\"Dereferenced NULL pointer allocated in %s, line %d\" source_file=\"%s\" source_line=\"%d\"")}, 263 263 { MSG_E_MMEM, SH_ERR_ERR, ERR, N_("msg=\"Out of memory\" source_file=\"%s\" source_line=\"%d\"")}, 264 264 { MSG_E_MREC, SH_ERR_ERR, ERR, N_("msg=\"Free() on unrecorded block\" source_file=\"%s\" source_line=\"%d\"")}, -
trunk/src/sh_log_check.c
r252 r257 811 811 int sh_log_check_init (struct mod_type * arg) 812 812 { 813 #if !defined(HAVE_PTHREAD) 814 (void) arg; 815 #endif 816 813 817 if (ShLogmonActive == S_FALSE) 814 818 return SH_MOD_FAILED; -
trunk/src/sh_mem.c
r256 r257 112 112 #endif 113 113 114 static void ** sh_mem_merr_1; 115 114 116 void sh_mem_stat () 115 117 { 116 118 memlist_t * this; 117 119 memlist_t * merrlist = NULL; 118 120 119 121 SL_ENTER(_("sh_mem_stat")); 120 122 123 sh_mem_merr_1 = (void **) &merrlist; 121 124 122 125 if (Alloc_Count == Free_Count) … … 139 142 while (this != NULL) 140 143 { 144 memlist_t * merr = (memlist_t *) malloc (sizeof(memlist_t)); 145 146 memcpy(merr, this, sizeof(memlist_t)); 147 merr->next = merrlist; 148 merrlist = merr; 149 150 this = this->next; 151 } 152 153 SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem); 154 155 while (merrlist != NULL) 156 { 157 memlist_t * tmp = merrlist; 158 merrlist = merrlist->next; 159 141 160 sh_error_handle (SH_ERR_WARN, FIL__, __LINE__, 0, MSG_E_NOTFREE, 142 this->size, this->file, this->line); 143 this = this->next; 144 } 145 146 SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem); 161 tmp->size, tmp->file, tmp->line); 162 free(tmp); 163 } 164 147 165 SL_RET0(_("sh_mem_stat")); 148 166 } 149 167 168 static void ** sh_mem_merr_2; 169 150 170 void sh_mem_check () 151 171 { 152 172 memlist_t * this; 173 memlist_t * merrlist = NULL; 174 memlist_t * merr; 153 175 long nerr = 0; 154 176 155 177 SL_ENTER(_("sh_mem_check")); 178 179 sh_mem_merr_2 = (void **) &merrlist; 156 180 157 181 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_MSTAMP, … … 167 191 if ( this->address == NULL ) 168 192 { 169 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MNULL); 193 merr = (memlist_t *) malloc (sizeof(memlist_t)); 194 195 memcpy(merr, this, sizeof(memlist_t)); 196 merr->size = 2; 197 198 merr->next = merrlist; 199 merrlist = merr; 170 200 ++nerr; 171 201 } … … 174 204 if ( this->address[this->size] != CHECKBYTE ) 175 205 { 176 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MOVER, 177 this->file, this->line, FIL__, __LINE__); 206 merr = (memlist_t *) malloc (sizeof(memlist_t)); 207 208 memcpy(merr, this, sizeof(memlist_t)); 209 merr->size = 1; 210 211 merr->next = merrlist; 212 merrlist = merr; 178 213 ++nerr; 179 214 } 180 215 if ( this->real_address[SH_MEMMULT-1] != CHECKBYTE ) 181 216 { 182 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MUNDER, 183 this->file, this->line, FIL__, __LINE__); 217 merr = (memlist_t *) malloc (sizeof(memlist_t)); 218 219 memcpy(merr, this, sizeof(memlist_t)); 220 merr->size = 0; 221 222 merr->next = merrlist; 223 merrlist = merr; 184 224 ++nerr; 185 225 } … … 190 230 191 231 SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem); 232 233 while (merrlist != NULL) 234 { 235 memlist_t * tmp = merrlist; 236 merrlist = merrlist->next; 237 238 if (tmp->size == 2) 239 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MNULL, 240 tmp->file, tmp->line, FIL__, __LINE__); 241 if (tmp->size == 1) 242 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MOVER, 243 tmp->file, tmp->line, FIL__, __LINE__); 244 else 245 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MUNDER, 246 tmp->file, tmp->line, FIL__, __LINE__); 247 free(tmp); 248 } 249 192 250 SL_RET0(_("sh_mem_check")); 193 251 } … … 203 261 SH_MUTEX_RECURSIVE_INIT(mutex_mem); 204 262 SH_MUTEX_RECURSIVE_LOCK(mutex_mem); 263 205 264 the_realAddress = malloc(size + 2 * SH_MEMMULT); 206 265 … … 258 317 259 318 static void ** sh_mem_dummy_a; 319 static void ** sh_mem_merr_3; 260 320 261 321 void sh_mem_free (void * aa, char * file, int line) … … 263 323 memlist_t * this; 264 324 memlist_t * before; 325 memlist_t * merr; 326 memlist_t * merrlist = NULL; 265 327 unsigned long size = 0; 266 328 void * a; … … 271 333 a = aa; 272 334 sh_mem_dummy_a = &a; 335 sh_mem_merr_3 = (void **) &merrlist; 273 336 274 337 … … 276 339 { 277 340 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MNULL, 278 file, line );341 file, line, FIL__, __LINE__); 279 342 SL_RET0(_("sh_mem_free")); 280 343 } … … 307 370 if ( this->address[this->size] != CHECKBYTE ) 308 371 { 309 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MOVER, 310 this->file, this->line, file, line); 372 merr = (memlist_t *) malloc (sizeof(memlist_t)); 373 374 memcpy(merr, this, sizeof(memlist_t)); 375 merr->size = 1; 376 377 merr->next = merrlist; 378 merrlist = merr; 311 379 } 380 312 381 if ( this->real_address[SH_MEMMULT-1] != CHECKBYTE ) 313 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MUNDER, 314 this->file, this->line, file, line); 382 { 383 merr = (memlist_t *) malloc (sizeof(memlist_t)); 384 385 memcpy(merr, this, sizeof(memlist_t)); 386 merr->size = 0; 387 388 merr->next = merrlist; 389 merrlist = merr; 390 } 315 391 316 392 size = this->size; … … 325 401 if (this) 326 402 free(this); 403 327 404 ++Free_Count; 328 405 --Now_Alloc_Count; … … 332 409 ; /* label at end of compound statement */ 333 410 SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem); 411 412 while (merrlist != NULL) 413 { 414 memlist_t * tmp = merrlist; 415 merrlist = merrlist->next; 416 417 if (tmp->size == 1) 418 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MOVER, 419 tmp->file, tmp->line, file, line); 420 else 421 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MUNDER, 422 tmp->file, tmp->line, file, line); 423 free(tmp); 424 } 425 334 426 if (flag != 0) 335 427 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MREC, 336 428 file, line); 429 337 430 SL_RET0(_("sh_mem_free")); 338 431 } -
trunk/src/sh_portcheck.c
r253 r257 1618 1618 if (sh_portchk_active != S_FALSE) 1619 1619 { 1620 #ifdef SL_DEBUG1621 sh_error_handle(SH_ERR_NOTICE, FIL__, __LINE__, 0, MSG_E_SUBGEN,1622 _("Checking for open ports"),1623 _("sh_portchk_check"));1624 #else1625 1620 sh_error_handle(SH_ERR_INFO, FIL__, __LINE__, 0, MSG_E_SUBGEN, 1626 1621 _("Checking for open ports"), 1627 1622 _("sh_portchk_check")); 1628 #endif1629 1623 1630 1624 sh_portchk_reset_lists(); -
trunk/src/sh_processcheck.c
r253 r257 1360 1360 { 1361 1361 SH_MUTEX_LOCK(mutex_thread_nolog); 1362 #ifdef SL_DEBUG1363 sh_error_handle(SH_ERR_NOTICE, FIL__, __LINE__, 0, MSG_PCK_CHECK,1364 (unsigned long) sh_prochk_minpid,1365 (unsigned long) (sh_prochk_maxpid-1));1366 #else1367 1362 sh_error_handle((-1), FIL__, __LINE__, 0, MSG_PCK_CHECK, 1368 1363 (unsigned long) sh_prochk_minpid, 1369 1364 (unsigned long) (sh_prochk_maxpid-1)); 1370 #endif1371 1365 SH_MUTEX_UNLOCK(mutex_thread_nolog); 1372 1366 -
trunk/src/sh_suidchk.c
r253 r257 1456 1456 1457 1457 SH_MUTEX_LOCK(mutex_thread_nolog); 1458 sh_error_handle (SH_ERR_ NOTICE, FIL__, __LINE__, EINVAL, MSG_E_SUBGEN,1458 sh_error_handle (SH_ERR_INFO, FIL__, __LINE__, EINVAL, MSG_E_SUBGEN, 1459 1459 _("Checking for SUID programs"), 1460 _("s uidchk_check") );1460 _("sh_suidchk_check") ); 1461 1461 SH_MUTEX_UNLOCK(mutex_thread_nolog); 1462 1462
Note:
See TracChangeset
for help on using the changeset viewer.