git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b83dc09
)
Coverity: Avoid calling sort_strings (NULL, 0) on empty list.
author
Richard W.M. Jones
<rjones@redhat.com>
Wed, 8 Jun 2011 21:01:41 +0000
(22:01 +0100)
committer
Richard W.M. Jones
<rjones@redhat.com>
Mon, 13 Jun 2011 13:10:26 +0000
(14:10 +0100)
(cherry picked from commit
3ed8d5122026f37dd96cc7e8503c4f3ecf0afbb7
)
daemon/devsparts.c
patch
|
blob
|
history
diff --git
a/daemon/devsparts.c
b/daemon/devsparts.c
index
1781def
..
c8f0256
100644
(file)
--- a/
daemon/devsparts.c
+++ b/
daemon/devsparts.c
@@
-105,8
+105,9
@@
foreach_block_device (block_dev_func_t func)
return NULL;
}
- /* Sort the devices */
- sort_strings (r, size);
+ /* Sort the devices. Note that r might be NULL if there are no devices. */
+ if (r != NULL)
+ sort_strings (r, size);
/* NULL terminate the list */
if (add_string (&r, &size, &alloc, NULL) == -1) {