summaryrefslogtreecommitdiff
path: root/nis/nis_table.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nis_table.c')
-rw-r--r--nis/nis_table.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/nis/nis_table.c b/nis/nis_table.c
index 7b7422c5e1..1d607a49c4 100644
--- a/nis/nis_table.c
+++ b/nis/nis_table.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 1997-2015 Free Software Foundation, Inc.
+/* Copyright (c) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@suse.de>, 1997.
@@ -19,6 +19,7 @@
#include <assert.h>
#include <string.h>
#include <rpcsvc/nis.h>
+#include <libc-internal.h>
#include "nis_xdr.h"
#include "nis_intern.h"
@@ -175,6 +176,12 @@ __follow_path (char **tablepath, char **tableptr, struct ib_request *ibreq,
*tableptr = *tablepath;
}
+
+ /* Since tableptr is only set here, and it's set when tablepath is NULL,
+ which it is initially defined as, we know it will always be set here. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT (4.7, "-Wmaybe-uninitialized");
+
if (*tableptr == NULL)
return NIS_NOTFOUND;
@@ -182,6 +189,8 @@ __follow_path (char **tablepath, char **tableptr, struct ib_request *ibreq,
if (newname[0] == '\0')
return NIS_NOTFOUND;
+ DIAG_POP_NEEDS_COMMENT;
+
newname = strdup (newname);
if (newname == NULL)
return NIS_NOMEMORY;