瀏覽代碼

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;