summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-09-19 15:59:57 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-09-19 15:59:57 +0200
commitaf00a17308fd17ea454021649a36f2f397a6da2b (patch)
tree138098c7986bae71898fa3c4748ae3114ad74dd1
parent034204d3d8d1a32b1a20e50697c5f81db6fb20cf (diff)
downloaduca-af00a17308fd17ea454021649a36f2f397a6da2b.tar.gz
uca-af00a17308fd17ea454021649a36f2f397a6da2b.tar.bz2
uca-af00a17308fd17ea454021649a36f2f397a6da2b.tar.xz
uca-af00a17308fd17ea454021649a36f2f397a6da2b.zip
Fix segfault
-rw-r--r--src/uca-plugin-manager.c6
-rw-r--r--test/benchmark.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/uca-plugin-manager.c b/src/uca-plugin-manager.c
index 7788678..bb27215 100644
--- a/src/uca-plugin-manager.c
+++ b/src/uca-plugin-manager.c
@@ -86,7 +86,9 @@ get_camera_names_from_directory (const gchar *path)
if (g_match_info_matches (match_info)) {
gchar *word = g_match_info_fetch (match_info, 1);
- result = g_list_append (result, word);
+
+ if (word != NULL)
+ result = g_list_append (result, word);
}
name = g_dir_read_name (dir);
@@ -100,7 +102,7 @@ GList *
uca_plugin_manager_get_available_cameras (UcaPluginManager *manager)
{
UcaPluginManagerPrivate *priv;
- GList *camera_names;
+ GList *camera_names = NULL;
g_return_val_if_fail (UCA_IS_PLUGIN_MANAGER (manager), NULL);
diff --git a/test/benchmark.c b/test/benchmark.c
index 1604cdb..73b6805 100644
--- a/test/benchmark.c
+++ b/test/benchmark.c
@@ -38,16 +38,14 @@ sigint_handler(int signal)
static void
print_usage (void)
{
- /* gchar **types; */
GList *types;
UcaPluginManager *manager;
manager = uca_plugin_manager_new ();
g_print ("Usage: benchmark [");
- /* types = uca_camera_get_types (); */
types = uca_plugin_manager_get_available_cameras (manager);
- if (g_list_length (types) == 0) {
+ if (types == NULL) {
g_print ("] -- no camera plugin found\n");
return;
}