Skip to content

Commit 0a9a97b

Browse files
Yugendstevegrubb
authored andcommitted
update error messages in NULL Checks
1 parent 1d63ffe commit 0a9a97b

File tree

17 files changed

+21
-12
lines changed

17 files changed

+21
-12
lines changed

audisp/audispd-llist.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ void plist_append(conf_llist *l, plugin_conf_t *p)
7575

7676
newnode = malloc(sizeof(lnode));
7777
if (newnode == NULL) {
78+
printf("Out of memory. Check %s file, %d line", __FILE__, __LINE__);
7879
return;
7980
}
8081

audisp/plugins/zos-remote/zos-remote-queue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ void increase_queue_depth(unsigned int size)
131131

132132
tmp_q = realloc(q, size * sizeof(BerElement *));
133133
if (tmp_q == NULL) {
134-
log_err("Memory allocation error");;
134+
log_err("Out of memory. Check %s file, %d line", __FILE__, __LINE__);
135135
pthread_mutex_unlock(&queue_lock);
136136
return;
137137
}

audisp/queue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ void increase_queue_depth(unsigned int size)
230230

231231
tmp_q = realloc(q, size * sizeof(event_t *));
232232
if (tmp_q == NULL) {
233-
fprintf(stderr, "Memory allocation error");
233+
fprintf(stderr, "Out of Memory. Check %s file, %d line", __FILE__, __LINE__);
234234
pthread_mutex_unlock(&queue_lock);
235235
return;
236236
}

auparse/auparse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static int setup_log_file_array(auparse_state_t *au)
114114
num--;
115115
tmp = malloc((num+2)*sizeof(char *));
116116
if (!tmp) {
117-
fprintf(stderr, "No memory\n");
117+
fprintf(stderr, "Out of memory. Check %s file, %d line", __FILE__, __LINE__);
118118
aup_free_config(&config);
119119
free(filename);
120120
return 1;

auparse/normalize-llist.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ void cllist_append(cllist *l, uint32_t num, void *data)
6767

6868
newnode = malloc(sizeof(data_node));
6969
if (newnode == NULL) {
70+
printf("Out of memory. Check %s file, %d line", __FILE__, __LINE__);
7071
return;
7172
}
7273

auparse/normalize.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ static int normalize_compound(auparse_state_t *au)
11921192
const char *exe = auparse_interpret_field(au);
11931193
D.how = strdup(exe);
11941194
if (D.how == NULL) {
1195-
fprintf(stderr, "Memory allocation error");
1195+
fprintf(stderr, "Out of memory. Check %s file, %d line", __FILE__, __LINE__);
11961196
free((void *)syscall);
11971197
return 1;
11981198
}
@@ -2007,7 +2007,7 @@ static int normalize_simple(auparse_state_t *au)
20072007
const char *exe = auparse_interpret_field(au);
20082008
D.how = strdup(exe);
20092009
if (D.how == NULL) {
2010-
fprintf(stderr, "Memory allocation error");
2010+
fprintf(stderr, "Out of memory. Check %s file, %d line", __FILE__, __LINE__);
20112011
return 1;
20122012
}
20132013
if ((strncmp(D.how, "/usr/bin/python", 15) == 0) ||

lib/gen_tables.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ output_i2s(const char *prefix)
272272

273273
unique_values = malloc(NUM_VALUES * sizeof(*unique_values));
274274
if (unique_values == NULL) {
275-
fprintf(stderr, "Memory allocation error");
275+
fprintf(stderr, "Out of memory. Check %s file, %d line", __FILE__, __LINE__);
276276
abort();
277277
}
278278
n = 0;
@@ -355,7 +355,7 @@ output_i2s_transtab(const char *prefix)
355355
}
356356
uc_prefix = strdup(prefix);
357357
if (uc_prefix == NULL) {
358-
fprintf(stderr, "Memory allocation error");
358+
fprintf(stderr, "Out of memory. Check %s file, %d line", __FILE__, __LINE__);
359359
abort();
360360
}
361361
for (i = 0; uc_prefix[i] != '\0'; i++)

src/auditctl-llist.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ void list_append(llist *l, struct audit_rule_data *r, size_t sz)
6565

6666
newnode = malloc(sizeof(lnode));
6767
if (newnode == NULL) {
68+
printf("Out of memory. Check %s file, %d line", __FILE__, __LINE__);
6869
return;
6970
}
7071

src/auditctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ static int fileopt(const char *file)
13411341
i = 0;
13421342
fields = malloc(nf * sizeof(char *));
13431343
if (fields == NULL) {
1344-
audit_msg(LOG_ERR, "Memory allocation error");
1344+
audit_msg(LOG_ERR, "Out of memory. Check %s file, %d line", __FILE__, __LINE__);
13451345
return 1;
13461346
}
13471347

src/ausearch-avc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ void alist_append(alist *l, anode *node)
6868

6969
newnode = malloc(sizeof(anode));
7070
if (newnode == NULL) {
71+
printf("Out of memory. Check %s file, %d line", __FILE__, __LINE__);
7172
return;
7273
}
7374

0 commit comments

Comments
 (0)