]> xenbits.xensource.com Git - libvirt.git/commitdiff
virNetDevOpenvswitchGetVhostuserIfname: Fix const correctness
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 13 May 2020 09:57:37 +0000 (11:57 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 13 May 2020 11:14:29 +0000 (13:14 +0200)
The @tmpIfname is a pointer into a const string. To avoid
mistakenly changing the const string via the pointer, make the
pointer const too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virnetdevopenvswitch.c

index c4cf2cf4766f394a59c67367f5633e8dd4486d53..bc6a1300350c352d82c8b1372c7c883c852b96a2 100644 (file)
@@ -483,7 +483,7 @@ int
 virNetDevOpenvswitchGetVhostuserIfname(const char *path,
                                        char **ifname)
 {
-    char *tmpIfname = NULL;
+    const char *tmpIfname = NULL;
     int status;
     int ret = -1;
     g_autoptr(virCommand) cmd = NULL;