Преглед на файлове

add a missing nullpointer check

Felix Fietkau преди 16 години
родител
ревизия
a428a41ac9
променени са 1 файла, в които са добавени 2 реда и са изтрити 0 реда
  1. 2 0
      list.c

+ 2 - 0
list.c

@@ -218,6 +218,8 @@ int uci_lookup(struct uci_context *ctx, struct uci_element **res, struct uci_pac
 	if (option) {
 		s = uci_to_section(e);
 		e = uci_lookup_list(ctx, &s->options, option);
+		if (!e)
+			goto notfound;
 	}
 
 	*res = e;