git://scientific.zcu.cz
/
jra1mw.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
31fc255
)
Fix crash on empty file.
author
František Dvořák
<valtri@civ.zcu.cz>
Fri, 25 Jun 2010 16:52:30 +0000
(16:52 +0000)
committer
František Dvořák
<valtri@civ.zcu.cz>
Fri, 25 Jun 2010 16:52:30 +0000
(16:52 +0000)
org.glite.lb.utils/src/purge.c
patch
|
blob
|
blame
|
history
diff --git
a/org.glite.lb.utils/src/purge.c
b/org.glite.lb.utils/src/purge.c
index
db3b1c1
..
73cf082
100644
(file)
--- a/
org.glite.lb.utils/src/purge.c
+++ b/
org.glite.lb.utils/src/purge.c
@@
-244,6
+244,11
@@
int main(int argc,char *argv[])
} else {
dprintf(("yes.\n"));
}
+ if (!jobs) {
+ dprintf(("File empty.\n"));
+ goto main_end;
+ }
+
request->jobs = jobs;
}
@@
-371,7
+376,7
@@
static int read_jobIds(const char *file, char ***jobs_out)
}
jobs[cnt++] = strdup(buf);
}
- jobs[cnt] = NULL;
+
if (jobs)
jobs[cnt] = NULL;
fclose(jobIds);
*jobs_out = jobs;