@@ -431,8 +431,6 @@ static int connect_handler(struct io_event *e) {
431431 const char * will_message = (const char * ) c -> payload .will_message ;
432432 // TODO check for will_topic != NULL
433433 struct topic * t = topic_store_get_or_put (server .store , will_topic );
434- if (!t )
435- log_fatal ("connect_handler failed: Out of memory" );
436434 if (!topic_store_contains (server .store , t -> name ))
437435 topic_store_put (server .store , t );
438436 // I'm sure that the string will be NUL terminated by unpack function
@@ -450,9 +448,6 @@ static int connect_handler(struct io_event *e) {
450448 }
451449 };
452450
453- if (!cc -> session -> lwt_msg .publish .topic || !cc -> session -> lwt_msg .publish .payload )
454- log_fatal ("connect_handler failed: Out of memory" );
455-
456451 cc -> session -> lwt_msg .header .bits .qos = c -> bits .will_qos ;
457452 // We must store the retained message in the topic
458453 if (c -> bits .will_retain == 1 ) {
@@ -569,8 +564,6 @@ static int subscribe_handler(struct io_event *e) {
569564 }
570565
571566 struct topic * t = topic_store_get_or_put (server .store , topic );
572- if (!t )
573- log_fatal ("subscribe_handler failed: Out of memory" );
574567 /*
575568 * Let's explore two possible scenarios:
576569 * 1. Normal topic (no single level wildcard '+') which can end with
@@ -719,8 +712,6 @@ static int publish_handler(struct io_event *e) {
719712 * create a new one with the name selected
720713 */
721714 struct topic * t = topic_store_get_or_put (server .store , topic );
722- if (!t )
723- log_fatal ("publish_handler failed: Out of memory" );
724715
725716 /* Check for # wildcards subscriptions */
726717 if (topic_store_wildcards_empty (server .store )) {
0 commit comments