[gnome-applets] battstat: fix memory leak



commit 2f74f21832ca023b14c300eb5702df8cb3d28f25
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Tue Mar 24 21:06:16 2020 +0200

    battstat: fix memory leak

 battstat/src/battstat-upower.c | 4 ++--
 battstat/src/battstat-upower.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/battstat/src/battstat-upower.c b/battstat/src/battstat-upower.c
index faf14f9cb..235833f9e 100644
--- a/battstat/src/battstat-upower.c
+++ b/battstat/src/battstat-upower.c
@@ -71,14 +71,14 @@ device_removed_cb (UpClient *client, const gchar *object_path, gpointer user_dat
 
 /* ---- public functions ---- */
 
-char *
+const char *
 battstat_upower_initialise (void (*callback) (void))
 {
   status_updated_callback = callback;
   GPtrArray *devices;
 
   if( upc != NULL )
-    return g_strdup( "Already initialised!" );
+    return "Already initialised!";
 
   if( (upc = up_client_new() ) == NULL )
     goto error_out;
diff --git a/battstat/src/battstat-upower.h b/battstat/src/battstat-upower.h
index 7f46a257f..278ad173f 100644
--- a/battstat/src/battstat-upower.h
+++ b/battstat/src/battstat-upower.h
@@ -23,7 +23,7 @@
 #ifndef _battstat_upower_h_
 #define _battstat_upower_h_
 
-char *battstat_upower_initialise (void (*) (void));
+const char *battstat_upower_initialise (void (*) (void));
 void battstat_upower_cleanup (void);
 
 #include "battstat.h"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]