Fix crash when unloading GData plugin when it's not configured.
[claws.git] / src / plugins / gdata / cm_gdata_contacts.c
index 86fc265a5a665923a26f11aee4369c6d02f1d54f..fb7526396f35e22f7abcc422f99b5729e2c655b5 100644 (file)
@@ -638,10 +638,12 @@ void cm_gdata_contacts_done(void)
 #if GDATA_CHECK_VERSION(0,17,2)
     /* store refresh token */
     pass = gdata_oauth2_authorizer_dup_refresh_token(authorizer);
-               passwd_store_set(PWS_PLUGIN, "GData", GDATA_TOKEN_PWD_STRING, pass,
-                               FALSE);
-    memset(pass, 0, strlen(pass));
-    g_free(pass);
+               if (pass != NULL) {
+                       passwd_store_set(PWS_PLUGIN, "GData", GDATA_TOKEN_PWD_STRING, pass,
+                                       FALSE);
+           memset(pass, 0, strlen(pass));
+           g_free(pass);
+               }
 #endif
 
     g_object_unref(G_OBJECT(authorizer));