Missing error handling: ust_app_ht_alloc should return error status
[lttng-tools.git] / src / bin / lttng-sessiond / ust-app.c
index 3abd12716818b4aa60a95b35869c19ea89b137ac..9ab5f77e0067b8f129b8ce4e17c2bba12d386f43 100644 (file)
@@ -3438,11 +3438,21 @@ void ust_app_clean_list(void)
 /*
  * Init UST app hash table.
  */
-void ust_app_ht_alloc(void)
+int ust_app_ht_alloc(void)
 {
        ust_app_ht = lttng_ht_new(0, LTTNG_HT_TYPE_ULONG);
+       if (!ust_app_ht) {
+               return -1;
+       }
        ust_app_ht_by_sock = lttng_ht_new(0, LTTNG_HT_TYPE_ULONG);
+       if (!ust_app_ht_by_sock) {
+               return -1;
+       }
        ust_app_ht_by_notify_sock = lttng_ht_new(0, LTTNG_HT_TYPE_ULONG);
+       if (!ust_app_ht_by_notify_sock) {
+               return -1;
+       }
+       return 0;
 }
 
 /*
This page took 0.023331 seconds and 4 git commands to generate.