]> git.ipfire.org Git - location/libloc.git/commitdiff
perl: No need to copy vendor onto the heap
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 26 Sep 2019 18:08:20 +0000 (18:08 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 26 Sep 2019 18:08:20 +0000 (18:08 +0000)
This is already and will be allocated as long as the database is

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/perl/Location/Location.xs

index 978f58f10e1eabd5b5f6a4a0e8946c802f8b718c..391dcb14ba2f1e4cec390afa694599ebd9724328 100644 (file)
@@ -83,18 +83,13 @@ get_country_code(db, address)
 
 
 
-char*
+const char*
 database_get_vendor(db)
        struct loc_database* db;
 
        CODE:
                // Get vendor
-               const char* vendor = loc_database_get_vendor(db);
-               if (!vendor) {
-                       croak("Could not retrieve vendor\n");
-               }
-
-               RETVAL = strdup(vendor);
+               RETVAL = loc_database_get_vendor(db);
        OUTPUT:
                RETVAL