if (getline(&line, &dummy, file) <= 0)
break;
if (strstr(line, "BUILD") != NULL) {
- char *c;
-
- c = strchr(line, '\n');
- if (c) *c = 0;
+ char *c, *build;
c = strstr(line, "BUILD");
c += 7;
- c = strdup(c);
+ build = strdup(c);
+
+ c = strchr(build, '\n');
+ if (c) *c = 0;
free(line);
fclose(file);
- return c;
+ return build;
+ } else {
+ free(line);
}
}
static void print_queue(void)
{
- struct oops *oops;
+ struct oops *oops, *next;
struct oops *queue;
int count = 0;
barrier();
oops = queue;
while (oops) {
- struct oops *next;
-
fprintf(stderr, "+ Submit text is:\n---[start of oops]---\n%s\n---[end of oops]---\n", oops->text);
next = oops->next;
free(oops->application);
oops = next;
count++;
}
-
}
static void write_logfile(int count, char *wsubmit_url)
while (oops) {
struct curl_httppost *post = NULL;
struct curl_httppost *last = NULL;
- struct oops *next;
unsigned int sum;
int i;
count++;
dup:
- next = oops->next;
- free(oops->application);
- free(oops->text);
- free(oops->filename);
- free(oops);
- oops = next;
+ oops = oops->next;
}
curl_easy_cleanup(handle);
void submit_queue(void)
{
int i;
- struct oops *queue;
+ struct oops *queue, *oops, *next;
CURL *handle;
memset(result_url, 0, 4096);
}
}
+
+
+ oops = queue;
+ while (oops) {
+ next = oops->next;
+ free(oops->application);
+ free(oops->text);
+ free(oops->filename);
+ free(oops);
+ oops = next;
+ }
+
curl_easy_cleanup(handle);
}