Code

dbi_test: Don't allocate any memory in dbi_driver_open_r().
authorSebastian Harl <sh@tokkee.org>
Wed, 14 May 2014 19:33:25 +0000 (21:33 +0200)
committerSebastian Harl <sh@tokkee.org>
Wed, 14 May 2014 19:33:25 +0000 (21:33 +0200)
This memory would be lost and appears as irrelevant noise in valgrind memory
checks.

t/unit/utils/dbi_test.c

index 8a0811bda72a71670a8aa921cf1c0bc7f3e33126..1ad96d123f6b6431b87f8cfc3a83872ccc37fb1b 100644 (file)
@@ -176,7 +176,7 @@ dbi_driver_open_r(const char *name, dbi_inst __attribute__((unused)) inst)
 {
        if (strcmp(name, "mockdriver"))
                return NULL;
-       return (dbi_driver)strdup(name);
+       return (dbi_driver)"mockdriver";
 } /* dbi_driver_open */
 
 dbi_driver