program.
if (conv_func != conv_noconv) {
len = (strlen(inbuf) + 1) * 3;
buf = g_malloc(len);
- if (!buf) return NULL;
if (conv_func(buf, len, inbuf) == 0 || !strict_mode)
return g_realloc(buf, strlen(buf) + 1);
return;
} else {
*dest = g_malloc(BUFFSIZE);
- if (*dest)
- conv_encode_header(*dest, BUFFSIZE, src, header_len, FALSE);
- else
- debug_print("notification_convert_header: alloc");
+ conv_encode_header(*dest, BUFFSIZE, src, header_len, FALSE);
}
}
while ((r = fscanf(file, "%s %llu\n", md5sum, &seen)) != EOF) {
if (t - (time_t)seen <= LIBRAVATAR_MISSING_TIME) {
time_t *value = g_malloc0(sizeof(time_t));
- if (value == NULL) {
- g_warning("cannot allocate memory");
- g_hash_table_destroy(table);
- table = NULL;
- goto close_exit;
- }
*value = (time_t)seen;
g_hash_table_insert(table, g_strdup(md5sum), value);
} else
time_t *seen = g_hash_table_lookup(table, md5);
if (seen == NULL) {
seen = g_malloc0(sizeof(time_t));
- if (seen == NULL) {
- g_warning("cannot allocate memory");
- return;
- }
*seen = t;
g_hash_table_insert(table, g_strdup(md5), seen);
debug_print("New md5 %s added with time %llu\n", md5, (long long unsigned)t);
len = BUFFSIZE;
buf = g_malloc(len);
- if (buf == NULL) {
- debug_print("generic_get_one_field: primary allocation error\n");
- *bufptr = NULL;
- return -1;
- }
+
if (hentry != NULL) {
/* skip non-required headers */
/* and get hentry header line */
/* read next line */
tmpbuf = g_malloc(BUFFSIZE);
- if (tmpbuf == NULL) {
- debug_print("generic_get_one_field: secondary allocation error\n");
- g_free(buf);
- *bufptr = NULL;
- return -1;
- }
+
if (getline(tmpbuf, BUFFSIZE, data) == NULL) {
g_free(tmpbuf);
break;